moment-timezone
moment-timezone copied to clipboard
Constructor using UTC to fill default values instead of named time zone
trafficstars
Right now I am EDT and it is 10pm. So 2am next day GMT.
The following code results in a date of tomorrow:
moment.tz({ hour: 12 }, "America/Los_Angeles").toString()
//Wed Aug 09 2017 12:00:00 GMT-0700
This was working fine earlier this afternoon. This seems like a bug. It should account for the day in the selected time zone when picking what date to use and it looks like it is probably just basing it off the day at GMT. If I am doing something wrong please let me know.
Also I am on an older version (0.5.4) so if this has been fixed please let me know.
Same issue with 0.5.13
Yes, it's a bug. You can work around it like so:
moment.tz("America/Los_Angeles").hour(12).toString()
Having this issue as well.