i have a different format of datetime. I get errors 'System.FormatException' when I try to parse it. how can I parse it?
?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)}
None of the answers posted deal with daylight savings as the offset is hardcoded or there is a database derivation.