mirror of
https://github.com/chronotope/chrono.git
synced 2025-09-26 20:40:51 +00:00
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:
parent
27c05589ac
commit
782f904375
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user