diff --git a/src/layout/json.rs b/src/layout/json.rs index 89f9848..36174f4 100644 --- a/src/layout/json.rs +++ b/src/layout/json.rs @@ -15,6 +15,7 @@ use std::fmt::Arguments; use jiff::tz::TimeZone; +use jiff::Timestamp; use jiff::Zoned; use log::Record; use serde::Serialize; @@ -97,7 +98,7 @@ impl JsonLayout { let record_line = RecordLine { timestamp: match self.tz.clone() { - Some(tz) => Zoned::now().with_time_zone(tz), + Some(tz) => Timestamp::now().to_zoned(tz), None => Zoned::now(), }, level: record.level().as_str(), diff --git a/src/layout/text.rs b/src/layout/text.rs index aacc4ad..3b1cf87 100644 --- a/src/layout/text.rs +++ b/src/layout/text.rs @@ -18,6 +18,7 @@ use colored::Color; use colored::ColoredString; use colored::Colorize; use jiff::tz::TimeZone; +use jiff::Timestamp; use jiff::Zoned; use log::Level; @@ -135,7 +136,7 @@ impl TextLayout { F: Fn(Arguments) -> anyhow::Result<()>, { let time = match self.tz.clone() { - Some(tz) => Zoned::now().with_time_zone(tz), + Some(tz) => Timestamp::now().to_zoned(tz), None => Zoned::now(), } .strftime("%Y-%m-%dT%H:%M:%S.%6f%:z");