How can a string timestamp with hours 0 to 24 be parsed
- by user897052
I am trying to parse a string timestamp of format "yyyyMMddHHmmss" with DateTime.ParseExact(). The catch is I must allow for an hour value of "24" (i.e. hours can be from 0 to 24; Note: I can't control the input values.) and, of course, that results in an exception.
Are there any settings/properties I can set instead of manually parsing/using regex's? If not, any efficient parsing ideas?
ex.
DateTime.ParseExact("20120911240000", "yyyyMMddHHmmss",
System.Globalization.CultureInfo.InvariantCulture);
hour 24 means hour 0 of next day (so day + 1, hour = 0)