Skip to content

Commit

Permalink
Clarify docs for DateTime::with_timezone
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kevincox authored and djc committed Jul 29, 2022
1 parent 27c0558 commit 782f904
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datetime/mod.rs
Expand Up @@ -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)
Expand Down

0 comments on commit 782f904

Please sign in to comment.