Hi folks,
I'm trying to parse a datestamp (that I got from Twitter) but am receiving errors. here's the datestamp:
Fri, 27 Aug 2010 22:00:07 +0000
Here's my code:
DateTime.ParseExact(MyDateValue, "ddd, dd MMM YYYY HH:mm:ss +ffff", new CultureInfo("en-US"))
and here's my error:
System.FormatException was unhandled Message=String was not recognized as a valid DateTime.
Anyone fancy taking that on? To make it easy I've provided the code below for a console app that exhibits the problem.
Thanks Jamie
using System;
using System.Globalization;
class Program
{
static void Main(string[] args)
{
string MyDateValue = "Fri, 27 Aug 2010 22:00:07 +0000";
var dt = DateTime.ParseExact(MyDateValue, "ddd, dd MMM YYYY HH:mm:ss +ffff", new CultureInfo("en-US"));
}
}