-
-
Save bantic/a0801aa2f5fccb9bb8e0 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
➜ npm ls | grep moment | |
├── moment@2.5.1 | |
├── moment-timezone@0.0.3 | |
➜ node -v | |
v0.10.16 | |
➜ node | |
> var moment = require('moment-timezone') | |
undefined | |
> var tz = 'America/New_York' | |
undefined | |
> moment( new Date(2013,2,10,23,59,59) ).tz(tz).endOf('day').toDate() | |
Mon Mar 11 2013 22:59:59 GMT-0400 (EDT) | |
// Expected: Sun Mar 10 2013 23:59:59 GMT-0400 (EDT) | |
> moment( new Date(2013,2,10,23,59,59) ).tz(tz).startOf('day').toDate() | |
Sat Mar 09 2013 23:00:00 GMT-0500 (EST) | |
// Expected: Sun Mar 10 2013 00:00:00 GMT-0500 (EST) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment