Clarify docs for DateTime::with_timezone

The previous docs don't really make sense, why am I calling a method if it doesn't change the value? The new wording clarifies what is held the same and what changes.
This commit is contained in:
Kevin Cox 2022-07-29 09:40:11 -04:00 committed by Dirkjan Ochtman
parent 27c05589ac
commit 782f904375

View File

@ -313,7 +313,7 @@ impl<Tz: TimeZone> DateTime<Tz> {
}
/// Changes the associated time zone.
/// This does not change the actual `DateTime` (but will change the string representation).
/// The returned `DateTime` references the same instant of time from the perspective of the provided time zone.
#[inline]
pub fn with_timezone<Tz2: TimeZone>(&self, tz: &Tz2) -> DateTime<Tz2> {
tz.from_utc_datetime(&self.datetime)