I'm receiving a bad parsing from the content in a database.
This is what I'm receiving and the date string.
FORMAT EXCEPTION: The string was not recognized as a valid DateTime. There is an unknown word starting at index 20.
11/02/2013 12:30:44 pm
I'm using DateTime.Parse(...)
, what do I need to change to perform the parsing?
use DateTime.ParseExact()
DateTime x = DateTime.ParseExact("11/02/2013 12:30:44 p.m.", "dd/MM/yyyy hh:mm:ss tt", null)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.