Yuri6037 / time-tz

Implementation of tz database (IANA) for time Rust crate.
BSD 3-Clause "New" or "Revised" License
22 stars 7 forks source link

Make assume_timezone UTC problem clear #7

Closed Yuri6037 closed 2 years ago

Yuri6037 commented 2 years ago

Currently the behavior of assume_timezone is ambiguous: one might expect the given PrimitiveDateTime to be in UTC, another could expect the function to directly accept a PrimitiveDateTime which is in the destination timezone.

I think the way forward is to deprecate the function assume_timezone as soon as possible, forwarding users to the replacement assume_timezone_utc which assumes the PrimitiveDateTime is already in UTC. Also necessary is to provide a clear documentation on how this new replacement actually works and make it clear it takes UTC!