aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan2018-12-10 18:55:33 +0100
committerRuben Pollan2018-12-10 18:55:33 +0100
commitdb241fa7ab7ce67420c4a6435e033743e810cdf0 (patch)
tree2654de21eac71ecbe8ffb25c914e8c13af62825f
parent31289cb298ee81f5cd7023a2f3434244c7ecb972 (diff)
Print times in the local timezone
-rw-r--r--src/date.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/date.rs b/src/date.rs
index a4559e7..ab1c2c8 100644
--- a/src/date.rs
+++ b/src/date.rs
@@ -4,7 +4,7 @@ use std::ops::Add;
use errors::EventError;
use chrono;
-use chrono::{TimeZone, Duration, Datelike};
+use chrono::{TimeZone, Duration, Datelike, Local};
use chrono::offset::Utc;
use chrono_tz::{Tz, UTC};
@@ -63,7 +63,7 @@ impl Date {
pub fn format(&self, fmt: &str) -> String {
match *self {
- Date::Time(t) => t.format(fmt).to_string(),
+ Date::Time(t) => t.with_timezone(&Local).format(fmt).to_string(),
Date::AllDay(d) => d.format(fmt).to_string(),
}
}