diff --git a/src/components/utils/logitems.rs b/src/components/utils/logitems.rs index cbf3c6ff..12d72862 100644 --- a/src/components/utils/logitems.rs +++ b/src/components/utils/logitems.rs @@ -31,10 +31,12 @@ impl From for LogEntry { if date.is_none() { log::error!("error reading commit date: {hash_short} - timestamp: {}",c.time); } - DateTime::::from(DateTime::::from_utc( - date.unwrap_or_default(), - Utc, - )) + DateTime::::from( + DateTime::::from_naive_utc_and_offset( + date.unwrap_or_default(), + Utc, + ), + ) }; let author = c.author; diff --git a/src/components/utils/mod.rs b/src/components/utils/mod.rs index f70397b5..7d32a40f 100644 --- a/src/components/utils/mod.rs +++ b/src/components/utils/mod.rs @@ -28,11 +28,13 @@ macro_rules! try_or_popup { /// helper func to convert unix time since epoch to formated time string in local timezone pub fn time_to_string(secs: i64, short: bool) -> String { - let time = DateTime::::from(DateTime::::from_utc( - NaiveDateTime::from_timestamp_opt(secs, 0) - .unwrap_or_default(), - Utc, - )); + let time = DateTime::::from( + DateTime::::from_naive_utc_and_offset( + NaiveDateTime::from_timestamp_opt(secs, 0) + .unwrap_or_default(), + Utc, + ), + ); time.format(if short { "%Y-%m-%d"