-
Notifications
You must be signed in to change notification settings - Fork 837
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
Strict mode and Unix timestamp. #555
Comments
I can't reproduce this. It returns the correct results in both cases. Can you please create a jsFiddle (or similar) to reproduce? Thanks. |
Also, have you changed the default time zone? We have a bug open on that in #338. |
Hi Matt, thanks for the feedback. No i did not changed the default time zone. Here is a jsbin example https://jsbin.com/yumosen/edit?js,output and here is a screenshot of the results on my computer: Maybe is a misunderstanding, on my part. On the docs i can see now clearly: "There are two interfaces for using time zones with Moment.js.moment.tz(..., String) is used to create a moment with a time zone, and moment().tz(String) is used to change the time zone on an existing moment." Maybe i confused by this part: Aris |
Hmm but wait on both cases (1,2 and 3,4) i'm using the moment.tz() method. On the 1,2 shifts the time and on the (3,4) is not. |
Ok, I'm dumb.. This was indeed fixed already in moment-timezone 0.5.14 and missed in the release notes. PR #348 fixed it. Please upgrade. (Also I note your moment 2.18.1 can upgrade to 2.19.1 also) |
// Correct
moment.tz(1509383108 * 1000, 'America/Caracas').format(); // "2017-10-30T13:05:08-04:00"
moment.tz(1509383108 * 1000, 'Europe/Athens').format(); // "2017-10-30T19:05:08+02:00"
// Wrong
moment.tz(1509383108, 'X', true, 'America/Caracas').format(); // "2017-10-30T17:05:08-04:00"
moment.tz(1509383108, 'X', true, 'Europe/Athens').format(); // "2017-10-30T17:05:08+02:00"
I was expecting a time shift with the last two examples but only tz is changed is that a bug?
moment version: 2.18.1
moment.tz version: 0.5.13
The text was updated successfully, but these errors were encountered: