Create a DateTime with the current date and time : DateTime : Date Time C# Examples


C# Examples » Date Time » DateTime »

 

Create a DateTime with the current date and time









    
using  System;

class  MainClass
{
        public  static  void  Main(string[]  args)
        {
                DateTime  now  =  DateTime.Now;
                Console.WriteLine("Now      :  {0}",  now);
        }
}
    
   
  
   



Output

Now   : 25/03/2007 2:10:52 PM


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Date Time
» DateTime