Created
October 22, 2010 18:23
-
-
Save rmanalan/641095 to your computer and use it in GitHub Desktop.
Nice little date to int sugar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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