Click here to Skip to main content
15,921,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,


How can I convert the time from the format "Thu Jun 09 2011 00:00:00 GMT+0530 (India Standard Time)" to mm/dd/yyyy HH:MM:SS format in C#

Thank you
Posted
Updated 6-May-13 0:48am
v2

DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss");
 
Share this answer
 
you can make use of DataFormatString. Thu Jun 09 2011 00:00:00 GMT+0530 (India Standard Time) is displayed using Full date/time pattern (long time){0:F}.What you need is Sortable date/time pattern {0:s}/Short time pattern {0:t}.
 
Share this answer
 
v2
Convert.ToDateTime("THU JUN 09 2011 00:00:00").ToString("MM/dd/yyyy hh:mm.ss");
 
Share this answer
 

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