Skip to content

Instantly share code, notes, and snippets.

@jpoz
Created June 23, 2011 18:38
Show Gist options
  • Save jpoz/1043228 to your computer and use it in GitHub Desktop.
Save jpoz/1043228 to your computer and use it in GitHub Desktop.
var current_date = new Date;
// Thu Jun 23 2011 11:35:42 GMT-0700 (PDT)
current_date - 3600000 // minus an hour
// => 1308850542267
current_date + 3600000 // plus an hour
// => "Thu Jun 23 2011 11:35:42 GMT-0700 (PDT)3600000" ARE YOU KIDDING ME!!!
current_date - (-3600000) // plus an hour wtfjs
// 1308857742267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment