Skip to content

Instantly share code, notes, and snippets.

@rmanalan
Created October 22, 2010 18:23
Show Gist options
  • Save rmanalan/641095 to your computer and use it in GitHub Desktop.
Save rmanalan/641095 to your computer and use it in GitHub Desktop.
Nice little date to int sugar
// Here's a nice little shorthand I found recently:
new Date()
// will produce Fri Oct 22 2010 11:19:51 GMT-0700 (PDT), however,
+new Date()
// will produce 1287771628111 which is the number of milliseconds since midnight of January 1, 1970...
// which is equivalent to this:
new Date().getTime()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment