Created
September 17, 2014 00:57
-
-
Save tjstebbing/9cb995701574420d6777 to your computer and use it in GitHub Desktop.
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
// Watch me get today's Date like a boss.. | |
// In node: | |
var now = new Date(); // Wed Sep 17 2014 10:51:36 GMT+1000 (EST) | |
var today = new Date(now.toDateString()); // Wed Sep 17 2014 00:00:00 GMT+1000 (EST) | |
//Woo! it's still the 17th | |
//In mongo shell | |
var now = new Date(); // ISODate("2014-09-17T00:53:28.982Z") | |
var today = new Date(now.toDateString()); // ISODate("2014-09-16T14:00:00Z") | |
// WTF??! we've gone back in time, was toDateString being weird? | |
now.toDateString() // Wed Sep 17 2014 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment