I have "2010-12-20T11:36:28+0000". How do I parse it into DateTime?
Thanks
DateTime d = DateTime.Parse("2010-12-20T11:36:28+0000");
Works on my machine and parses time zone.
You can use ParseExact
or TryParseExact
with a Custom Date and Time Format String.
Tested:
var myDate = DateTime.ParseExact("2010-12-20T11:36:28+0000",
@"yyyy-MM-dd\THH:mm:ssK",
CultureInfo.InvariantCulture);
Having said that, DateTime.Parse
works perfectly well.
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