a better way of converting between timezones

This commit is contained in:
Abraham Toriz 2021-07-07 11:58:28 -05:00
parent c512e43c96
commit 07fa6d4f05
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
1 changed files with 1 additions and 1 deletions

View File

@ -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(),