How do i convert string 2018-05-10T14:29:00 to MM/dd/yyyy
I need to convert 2012-01-12T14:29:00 to MM/dd/yyyy hh:mm:ss date string format. How do i do it ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nitin SontakkePosted May 11, 2018, 9:21 PM
Istudent RanaPosted May 11, 2018, 2:04 PM
DateTime dtObject = dto.DateTime;
string result= dto.ToString("MM/dd/yyyy HH:mm:ss");
Istudent RanaPosted May 11, 2018, 1:51 PM
string formattedDate = date.ToString("MM/dd/yyyy HH:mm:ss");
Message=String was not recognized as a valid DateTime.
Nitin SontakkePosted May 10, 2018, 9:21 PM