Created
December 14, 2012 22:04
-
-
Save jeffreyiacono/4289072 to your computer and use it in GitHub Desktop.
javascript data stuff
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
| var today = new Date(); | |
| console.log("today: " + today); | |
| console.log("today.getTime(): " + today.getTime()); | |
| console.log("today.toISOString(): " + today.toISOString()); | |
| console.log("today.getTimezoneOffset(): " + today.getTimezoneOffset()); # returns in number of minutes | |
| console.log("today.getTimezoneOffset() * 60 * 1000: " + today.getTimezoneOffset() * 60 * 1000) # num mins * 60 = sec * 1000 to play nice w/ #getTime() | |
| today.setTime(today.getTime() - (today.getTimezoneOffset() * 60 * 1000)); | |
| console.log("today.toISOString(): " + today.toISOString()); | |
| console.log("today.getTime(): " + today.getTime()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment