diff --git a/libticker/src/ics/mod.rs b/libticker/src/ics/mod.rs index 6e361fc..df66d1f 100644 --- a/libticker/src/ics/mod.rs +++ b/libticker/src/ics/mod.rs @@ -1,7 +1,7 @@ use std::collections::{HashMap, HashSet}; use std::fmt::Write; use std::str::FromStr; -use chrono::{DateTime, NaiveDate, NaiveDateTime, Utc}; +use chrono::{DateTime, NaiveDate, NaiveDateTime, Local, Utc}; mod tokenizer; mod parser; @@ -94,7 +94,10 @@ impl FromStr for Timestamp { fn from_str(s: &'_ str) -> Result { NaiveDateTime::parse_from_str(s, "%Y%m%dT%H%M%SZ") - .map(|time| DateTime::::from_utc(time, Utc).naive_local()) + .map(|time| DateTime::::from_utc(time, Utc) + .with_timezone(&Local) + .naive_local() + ) .or_else(|_| NaiveDateTime::parse_from_str(s, "%Y%m%dT%H%M%S")) .map(Timestamp::DateTime) .or_else(|_|