Created
March 8, 2016 16:30
-
-
Save cdl/b13d1b92ba3222adf943 to your computer and use it in GitHub Desktop.
This file contains 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
// march 1 at 2:34pm | |
var date = moment('1456868040000', 'x'); | |
// get start of day | |
var start = date.startOf('day'); | |
start.format('LT LL'); // => 12:00 AM March 1, 2016 | |
// You'd think this'd still be 2:34PM but nope. | |
date.format('LT LL'); // => 12:00 AM March 1, 2016 | |
// WHY THE HECK DOES .startOf MUTATE THE ORIGINAL DATE INSTEAD OF JUST | |
// RETURNING THE MODIFIED DATE ?????? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment