I am fetching some data from some API, the date am getting is as below: {dd/MM/yyyy hh:mm:ss} "6/15/2014 6:45:00" Is there anyway I can directly convert it to date time ? Please guide.. Thanks in advance.
I tried .ToString(""), Convert.ToDateTime() and Parse/ExactPare but nothing work.
string date = "6/15/2014 6:45:00"; DateTime dt; if (DateTime.TryParseExact(date, "M/d/yyyy h:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt)) { Console.WriteLine(dt); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)