开发者

Cant parse string to datetime

开发者 https://www.devze.com 2023-03-08 05:07 出处:网络
DateTime startDate = DateTime.ParseExact(开发者_StackOverflow\"2011-05-25 24:00:00\", \"yyyy-MM-dd HH:mm:ss\", System.Globalization.CultureInfo.InvariantCulture);
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.

0

精彩评论

暂无评论...
验证码 换一张
取 消