time-rs / time

The most used Rust library for date and time handling.
https://time-rs.github.io
Apache License 2.0
1.06k stars 261 forks source link

Solve "large-dates" ambiguity #683

Open dennisorlando opened 1 month ago

dennisorlando commented 1 month ago

Hi, bson enables the "large-dates" feature, which means that when you add it to your crate, everything that parsed some time::PrimitiveDateTimes using the plain version of time will potentially break, due to some documented ambiguities. Is it possible to provide a way to solve those ambiguity, so that we don't have to change our program in order to handle different date-time formats? Maybe a way to provide the number of characters dedicated to the [year] value?

This is the datetime which causes problems when "large-dates" is enabled: 20240602205731Z

jhpratt commented 3 weeks ago

This is related to #650. After some thought, I should be able to add a modifier whose value would control whether the extended range can be used. This is what I want eventually anyway; the only difference would be that the default has to be backwards-compatible (essentially opt-out instead of opt-in).