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
rust-chrono has several methods which convert NaiveDate/Time to Date/Time<Off>, but there's no method which do Date/Time<T> to Date/Time<U>, where T and U are different Offsets.
There are two ways of converting the offset of the date/time object:
Preserve all of other fields, and replace only the offset info. This behavior likes Python's datetime.replace(tzinfo=new_tz). The duration between the result and the original will be same as a distance of their offsets.
Preserve the time, and adjust the date and time data. This behavior likes Python's datetime.astimezone(new_tz). They should have same UTC timestamp that the result and the original.
The text was updated successfully, but these errors were encountered:
rust-chrono has several methods which convert
NaiveDate/Time
toDate/Time<Off>
, but there's no method which doDate/Time<T>
toDate/Time<U>
, where T and U are differentOffset
s.There are two ways of converting the offset of the date/time object:
datetime.replace(tzinfo=new_tz)
. The duration between the result and the original will be same as a distance of their offsets.datetime.astimezone(new_tz)
. They should have same UTC timestamp that the result and the original.The text was updated successfully, but these errors were encountered: