【发布时间】:2017-06-21 01:26:45
【问题描述】:
我有不同的日期时间格式。我收到错误“System.FormatException” 当我尝试解析它时。怎么解析?
?time
"20170620 21:22:02 EST"
?DateTime.Parse(time)
'DateTime.Parse(time)' threw an exception of type 'System.FormatException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233033
HelpLink: null
InnerException: null
Message: "String was not recognized as a valid DateTime."
Source: "mscorlib"
StackTrace: " at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)\r\n at System.DateTime.Parse(String s)"
TargetSite: {System.DateTime Parse(System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles)}
由于偏移量是硬编码的或存在数据库派生,因此发布的答案均未涉及夏令时。
【问题讨论】:
-
它不是重复的,因为该链接不能解决夏令时偏移
标签: c#