We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Try this in GMT+0800 timezone:
GMT+0800
dayjs('2024-10-20T01:00:00').utc().utcOffset(0, true).set('hour', 2); // -> Sat, 19 Oct 2024 10:00:00 GMT dayjs('2024-10-20T01:00:00').utc().utcOffset(0, true); // -> Sun, 20 Oct 2024 01:00:00 GMT dayjs('2024-10-20T01:00:00').utc().utcOffset(0, true).add(1, 'hour'); // -> Sun, 20 Oct 2024 02:00:00 GMT // this also have wrong behavior dayjs('2024-10-20T01:00:00').utcOffset(0, true).set('hour', 2); // -> Sat, 19 Oct 2024 10:00:00 GMT dayjs('2024-10-20T01:00:00').utc(true).utcOffset(0, true).add(1, 'hour'); // -> Sun, 20 Oct 2024 10:00:00 GMT
The aim is to turn to user's timezone and then change hour or date, the timezone may be 0 ~12.
0 ~12
Expected behavior dayjs('2024-10-20T01:00:00').utc().utcOffset(0, true).set('hour', 2); should get Sun, 20 Oct 2024 02:00:00 GMT;
dayjs('2024-10-20T01:00:00').utc().utcOffset(0, true).set('hour', 2);
Sun, 20 Oct 2024 02:00:00 GMT
It seem because the utcOffset method doesn't change the $d.
utcOffset
$d
Information
The text was updated successfully, but these errors were encountered:
https://joseph-mathew.neetorecord.com/watch/03fcfa68-ba46-4aa7-8fc8-aabb8eace0ee
@iamkun Could you please check this issue? The UTC logic for the timezone plugin is added in PR #2693.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Try this in
GMT+0800
timezone:The aim is to turn to user's timezone and then change hour or date, the timezone may be
0 ~12
.Expected behavior
dayjs('2024-10-20T01:00:00').utc().utcOffset(0, true).set('hour', 2);
should getSun, 20 Oct 2024 02:00:00 GMT
;It seem because the
utcOffset
method doesn't change the$d
.Information
The text was updated successfully, but these errors were encountered: