-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
ZonedDateTime::of not working correctly with seconds part offset #35
Comments
Looks like we should or start throw exception on any seconds part start from TimeZoneOffset object, or rewrite ZonedDateTime::of logic to not use \DateTimeZone. |
Good finding! I don't think there is a use case for a time-zone offset with seconds, so I agree that we should throw an exception.
Just read the code again, and if I'm not mistaken, we should deny creating a
BTW, I think this should also be brought up on the internals mailing list, as it's a rather big annoyance. |
This will be fixed in PHP 8.1: https://bugs.php.net/bug.php?id=81097 Do you think we should throw an exception in earlier PHP versions, when seconds is not zero? |
Fixed in 01c7e25. We now prevent seconds altogether in |
Looks like \DateTimeZone with used in ZonedDateTime::of logic not working correctly with seconds in offset. It silently convert any offset with seconds to UTC timezone.
The text was updated successfully, but these errors were encountered: