-
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
Timezone Error in v0.5.45 #1099
Comments
This is looking like a bug to me. Kazakhstan is unifying to a single time zone at that exact time (see #1095), so However, the way this should play out is:
Moment Timezone has a way of handling ambiguous times (e.g. when the same time happens twice), but that shouldn't be applying here. For Almaty, the times 23:00:00 to 23:59:59 will happen twice on Feb 29, but Mar 1 00:00:00 only happens once. The curious thing is that other time zones that have had DST transitions at midnight (like Brazil) are handled correctly: moment.tz('2019-02-16 23:00:00', 'America/Sao_Paulo').format(); // '2019-02-16T23:00:00-02:00'
moment.tz('2019-02-16 23:59:59', 'America/Sao_Paulo').format(); // '2019-02-16T23:59:59-02:00'
moment.tz('2019-02-17 00:00:00', 'America/Sao_Paulo').format(); // '2019-02-17T00:00:00-03:00'
// This last one is actually one hour later than the time above, due to ambiguities listed earlier There's a poorly-documented data property to assist with the times that happen twice due to clock changes: moment.tz.moveAmbiguousForward = false; // the default
moment.tz('2024-03-01 00:00:00', 'Asia/Almaty').format(); // '2024-02-29T23:00:00+05:00'
moment.tz.moveAmbiguousForward = true;
moment.tz('2024-03-01 00:00:00', 'Asia/Almaty').format(); // '2024-03-01T00:00:00+05:00' I'll have to dig further to work out why this is happening only in this one case. |
您的邮件已收到,我会尽快给您回复。
|
Environment
Local timezone: Barcelona (GMT+1)
Aimed timezone: Almaty (GMT+6)
For bug reports, please run the following code in your environment and include the output:
Issue description
I'm trying to format the timezone of Almaty in my web app and found that for the first day of March at midnight, the library is returning
29/02/2024 23:00:00
. I'm not sure if this is expected behaviour or not, but I can't find a workaround to display01/03/2024 00:00:00
.The text was updated successfully, but these errors were encountered: