use the Parse() method to convert strings to DateTime instances : Date Time : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Date Time »

 

use the Parse() method to convert strings to DateTime instances








    
 
using System;

class MainClass {

    public static void Main() {

        DateTime myDateTime5 = DateTime.Parse("1/13/2004");
        DateTime myDateTime6 = DateTime.Parse("1/13/2004 23:10:30");
        Console.WriteLine("myDateTime5 = " + myDateTime5);
        Console.WriteLine("myDateTime6 = " + myDateTime6);


    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Date Time