Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to convert the date format "2015-06-26T00:00:00" to mm/dd/yyyy

What I have tried:

convert the string "2015-06-26T00:00:00" to 'dd/mm/yyyy'
Posted
Updated 20-Nov-16 21:32pm
Comments
Suvendu Shekhar Giri 21-Nov-16 3:36am    
Why?
What's the issue with a simple google search?

1 solution

C#
DateTime dt;
string result;
if (DateTime.TryParse("2015-06-26T00:00:00", out dt))
    result = dt.ToString("MM/dd/yyyy");
else
    // The input was invalid - handle it.
 
Share this answer
 
v2
Comments
Afzaal Ahmad Zeeshan 21-Nov-16 3:40am    
5ed.
F-ES Sitecore 21-Nov-16 4:50am    
I think you mean

if (DateTime.TryParse("2015-06-26T00:00:00", out dt))
Midi_Mick 21-Nov-16 4:52am    
thx - fixed.

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