Creating specific date/times : DateTime : Date Time C# Examples


C# Examples » Date Time » DateTime »

 

Creating specific date/times









    
using  System;
using  System.Collections.Generic;
using  System.Globalization;
using  System.IO;
using  System.Text;
using  System.Security.Cryptography;

public  class  MainClass
{
        public  static  void  Main()
        {
                DateTime  dt1  =  new  DateTime(2004,  10,  19);
                Console.WriteLine("dt1:  {0}",  dt1);
                DateTime  dt2  =  new  DateTime(2004,  10,  19,  22,  47,  35);
                Console.WriteLine("dt2:  {0}",  dt2);
                DateTime  dt3  =  new  DateTime(2004,  10,  19,  22,  47,  35,  259);
                Console.WriteLine("dt3:  {0}",  dt3);
        }
}
    
   
  
   



Output

dt1: 19/10/2004 12:00:00 AM
dt2: 19/10/2004 10:47:35 PM
dt3: 19/10/2004 10:47:35 PM


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Date Time
» DateTime