I’m talking about ones encoded in the format in which the twitter API returns its dates, like…
"Tue Jan 12 21:33:28 +0000 2010"
The best thing I thought of was to try to slice it up with regexes to become something more like…
20100112213328,
but there’s got to be a better way.
JavaScript Date will correctly parse the Twitter date :
The you can compare these using the getTime method which converts to numeric form:
Or, simply
If needs must, explicitly coerce to number: