a better way of converting between timezones
This commit is contained in:
parent
c512e43c96
commit
07fa6d4f05
|
@ -21,7 +21,7 @@ fn date_from_parts<T: TimeZone>(
|
|||
|
||||
match try_date {
|
||||
LocalResult::None => Err(Error::NoneLocalTime(input.into())),
|
||||
LocalResult::Single(t) => Ok(Utc.from_utc_datetime(&t.naive_utc())),
|
||||
LocalResult::Single(t) => Ok(t.with_timezone(&Utc)),
|
||||
LocalResult::Ambiguous(t1, t2) => Err(Error::AmbiguousLocalTime {
|
||||
orig: input.into(),
|
||||
t1: t1.naive_utc(),
|
||||
|
|
Loading…
Reference in New Issue