Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect result when parsing time in a timezone #867

Closed
createthis opened this issue Jun 19, 2020 · 1 comment
Closed

Incorrect result when parsing time in a timezone #867

createthis opened this issue Jun 19, 2020 · 1 comment

Comments

@createthis
Copy link

Repro steps:

import moment from 'moment-timezone';
import tk from 'timekeeper';
tk.freeze(moment('2020-06-19T20:00:00-04:00').toDate());
console.log('now=',moment().format());
const eight_pm_today = moment.tz('8:00 PM', 'h:mm A', 'America/New_York');
console.log('eight_pm_today=',eight_pm_today.format());

Result:

now= 2020-06-19T20:00:00-04:00
eight_pm_today= 2020-06-20T20:00:00-04:00

Expected Result:

now= 2020-06-19T20:00:00-04:00
eight_pm_today= 2020-06-19T20:00:00-04:00

(eight_pm_today is showing as the 20th rather than the 19th)

@ichernev
Copy link
Contributor

This is a duplicate of #874 (well the other way around, but I already commented on the other one ;-))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants