DateTime startDate = DateTime.ParseExact(开发者_StackOverflow"2011-05-25 24:00:00", "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
for some reason parsing this string to a datetime does not want to work. I Tried several things already but it just does not want to work. Most of the internet examples do it like this too. Does someone sees what is wrong?
thanks
"24:00:00"
is not a valid time. Should probably be "00:00:00"
. If you meant the second that comes after 2011-05-25 23:59:59
, that would be 2011-05-26 00:00:00
.
For more information about valid value ranges for different format specifiers, check Custom Date and Time Format Strings at MSDN.
精彩评论