-
Notifications
You must be signed in to change notification settings - Fork 164
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
ISO8601FormatStyle produces unexpected results when including fractional seconds #963
Comments
Hi, could not replicate, copy/pasting your snippet... on what versions are you? does the issue still exist?
|
Hey! Thank you for checking!
|
I had the same issue in my own project (not swift-openapi) when I updated my own iPhone, I first opened a thread on the Swift forums: https://forums.swift.org/t/rounding-error-in-milliseconds-using-iso8601formatstyle-instead-of-iso8601dateformatter/75206 I also opened this case on the feedback assistant: FB15418195 (Rounding error in milliseconds using ISO8601FormatStyle on iOS 18.0)
It happens when using iOS 18. I have no idea how the implementation of this works, is it baked inside iOS? Could it be due to this change perhaps: 337a22e ? |
seems to be a problem of 6.0 vs 5.10 which matches the date of the change.. ill have a look over the weekend |
@LordBurtz isn't this baked in the iOS version? How could I test this myself? |
@parkera is this something you could help with when you get a chance? 🙇🏻 |
@stephentyrone was looking into this |
We encountered the exact same issue. In some cases it's converted correctly, in others it's off by one. Any indication when this will be fixed? It causes several issues in operations that require accuracy, especially when the value needs to be serialized and sent to a backend. |
After the last comment I thought stephentyrone was taking care of this but i'll investigate it this weekend probably |
While working on apple/swift-openapi-generator#637, I noticed
ISO8601FormatStyle
formattes dates with fractional seconds incorreclty. The fractional seconds field is off by one.Also, when parsing a formatted date with fractional seconds, the result is not equal to the initial formatted date.
You can reproduce the issue with the following code snippet.
The text was updated successfully, but these errors were encountered: