From db241fa7ab7ce67420c4a6435e033743e810cdf0 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Mon, 10 Dec 2018 18:55:33 +0100 Subject: Print times in the local timezone --- src/date.rs | 4 ++-- 1 file 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(), } } -- cgit v1.2.3