Skip to content

Conversation

@ostgals
Copy link
Contributor

@ostgals ostgals commented Nov 15, 2023

Actually .utcOffset(0, flag) is the same as .utc(flag) but .utcOffset with keepLocalTime = true didn't modify the internal date accordingly. That caused a bug described in #2501

Fixed .utcOffset by returning .utc(keepLocalTime) if passed offset is zero.

Added some tests to cover possible mismatches.

@iamkun iamkun changed the title Fix: .utcOffset(0, true) result and its clone are different fix: .utcOffset(0, true) result and its clone are different Aug 27, 2025
@iamkun
Copy link
Owner

iamkun commented Aug 27, 2025

Thanks

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

Successfully merging this pull request may close these issues.

2 participants