You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The definition of a timestamp is that it is a value in UTC.
We don't know how a NaiveDateTime relates to UTC. So having methods on this type to convert to and from timestamps is in theory not correct.
The time crate chooses to not have any timestamp related methods on its PrimitiveDateTime for this reason.
Workarounds are not that problematic.
If the NaiveDate is in UTC dt.timestamp() would become dt.and_utc().timestamp(). NaiveDate::from_timestamp(ts, 0) would become Utc.timestamp(ts, 0).naive_utc().
Deprecating these methods can help users notice invalid assumptions, and removes 13 methods from our API surface.
The text was updated successfully, but these errors were encountered:
pitdicker
changed the title
Deprecated all timestamp-related methods on NaiveDateTime
Deprecate all timestamp-related methods on NaiveDateTimeFeb 28, 2024
The definition of a timestamp is that it is a value in UTC.
We don't know how a
NaiveDateTime
relates to UTC. So having methods on this type to convert to and from timestamps is in theory not correct.The time crate chooses to not have any timestamp related methods on its
PrimitiveDateTime
for this reason.Workarounds are not that problematic.
If the
NaiveDate
is in UTCdt.timestamp()
would becomedt.and_utc().timestamp()
.NaiveDate::from_timestamp(ts, 0)
would becomeUtc.timestamp(ts, 0).naive_utc()
.Deprecating these methods can help users notice invalid assumptions, and removes 13 methods from our API surface.
The text was updated successfully, but these errors were encountered: