How to convert GMT timestamp to Unix timestamp (javascript)

I am parsing an rss feed and each record has a timestamp like: 2009-09-21T21: 24: 43 + 04: 00 Is there a way to convert this date format to a unix timestamp using javascript?

I just want to record the last rss registration date, but I need to standardize GMT time or Unix timestamp for this.

+1
javascript timestamp
Sep 22 '09 at 0:47
source share
2 answers

The format looks like ISO-8601. Assuming this is true, this blog provides a javascript solution for this.

0
Sep 22 '09 at 1:15
source share

Since I met the same problem, a solution including the 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(); 
0
Aug 20 2018-12-12T00:
source share



All Articles