So, i have this string "Date: Mon Jan 03 2011 19:29:44 GMT+0200", and when i use DateTime.Parse(date).ToString(); i'm getting "String was not recognized as a valid DateTime."
If i remove the '+0200' part it works ok, but ofcourse it doesn't show the correct local time. What's wrong with that?
From the documentation, it seems that DateTime.Parse()
only understands:
The GMT
designator, used alone, e.g. Mon, Jan 03 2011 17:29:44 GMT
, or
A time zone offset specified without the GMT
designator, e.g. Mon, Jan 03 2011 19:29:44+02:00
.
You might want to convert your date string to the second form.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With