I'm parsing an rss feed and each entry has a timestamp such as this: 2009-09-21T21:24:43+04:00 Is there any way to convert this date format to a unix timestamp with javascript?
I just want to be able to record the latest rss entry date, but I need to standardize the time to GMT time or Unix timestamp to do this.
The format appears to be ISO-8601. Assuming that is true, this blog provides a javascript solution to this.
As I met the same problem, the solution involving Google Closure Library would be:
var pattern = "yyyy-MM-ddTHH:mm:ssZZZZZ"; parser = goog.i18n.DateTimeParse(pattern); var d = new Date(); parser.parse("2009-09-21T21:24:43+04:00", d); unixTime = d.getTime();