Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this post on the web showing how to do it. However, the format string in the post is setup for non-us format so I thought I would share how to do it for US formatted datetime.
const string format = "ddd MMMM dd HH:mm:ss zzzz yyyy";
var d = DateTime.ParseExact("Thu May 24 11:43:52 +0000 2012", format, System.Globalization.CultureInfo.InvariantCulture)
Hope this helps.
Till next time,
DIGITAL JUICE
No comments:
Post a Comment
Thank's!