Skip to content

Instantly share code, notes, and snippets.

@quickredfox
Created April 23, 2012 15:55
Show Gist options
  • Save quickredfox/2471842 to your computer and use it in GitHub Desktop.
Save quickredfox/2471842 to your computer and use it in GitHub Desktop.
Cross-browser, time-zone-aware parsing via JavaScript:
var s = "Fri Apr 09 12:53:54 +0000 2010";
var date = new Date(
s.replace(/^\w+ (\w+) (\d+) ([\d:]+) \+0000 (\d+)$/,
"$1 $2 $4 $3 UTC"));
Tested on IE, Firefox, Safari, Chrome and Opera.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment