Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
for example convert "20.12.2012" to datetime
Posted
Comments
nitin malik bit 27-Apr-12 3:37am    
thanks and this is working

The DateTime.ParseExact method can be used as shown below
C#
DateTime date = DateTime.ParseExact("20.12.2012", "dd.MM.yyyy",
                 System.Globalization.CultureInfo.InvariantCulture);
 
Share this answer
 
v3
C#
DateTime dt = DateTime.ParseExact("20.12.2012", "dd.MM.yyyy", CultureInfo.InvariantCulture);
 
Share this answer
 
Comments
(__Aaron__) 27-Apr-12 5:21am    
my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900