Skip to content

Instantly share code, notes, and snippets.

@AshCoolman
Created July 31, 2014 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshCoolman/9200a4b7624471484d44 to your computer and use it in GitHub Desktop.
Save AshCoolman/9200a4b7624471484d44 to your computer and use it in GitHub Desktop.
//http://biostall.com/javascript-new-date-returning-nan-in-ie-or-invalid-date-in-safari
var d = new Date(2011, 01, 07); // yyyy, mm-1, dd
var d = new Date(2011, 01, 07, 11, 05, 00); // yyyy, mm-1, dd, hh, mm, ss
var d = new Date("02/07/2011"); // "mm/dd/yyyy"
var d = new Date("02/07/2011 11:05:00"); // "mm/dd/yyyy hh:mm:ss"
var d = new Date(1297076700000); // milliseconds
var d = new Date("Mon Feb 07 2011 11:05:00 GMT"); // ""Day Mon dd yyyy hh:mm:ss GMT/UTC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment