diff options
author | Hendrik Sollich <hendrik@hoodie.de> | 2016-11-18 00:20:55 +0100 |
---|---|---|
committer | Hendrik Sollich <hendrik@hoodie.de> | 2016-11-18 00:20:55 +0100 |
commit | de429c8fc70f2abae43b34f0ab71739211073683 (patch) | |
tree | 5c70cc2c1e8cec8344bedd9976d0f0ba4bb7aef5 | |
parent | b9f84067f697797b6ec63c180d032852e1d3b82c (diff) |
producing local instead of UTC times
-rw-r--r-- | src/components.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components.rs b/src/components.rs index 2a1307f..3f8a51e 100644 --- a/src/components.rs +++ b/src/components.rs @@ -55,7 +55,7 @@ pub trait Component { fn fmt_write<W: fmt::Write>(&self, out: &mut W) -> Result<(), fmt::Error> { writeln!(out, "BEGIN:{}", Self::component_kind())?; - let now = UTC::now().format("%Y%m%dT%H%M%SZ"); + let now = UTC::now().format("%Y%m%dT%H%M%S"); writeln!(out, "DTSTAMP:{}", now)?; writeln!(out, "UID:{}", Uuid::new_v4())?; @@ -87,7 +87,7 @@ pub trait Component { where TZ::Offset: fmt::Display { // DTSTART - self.add_property("DTSTART", dt.format("%Y%m%dT%H%M%SZ").to_string().as_ref()); + self.add_property("DTSTART", dt.format("%Y%m%dT%H%M%S").to_string().as_ref()); self } @@ -95,7 +95,8 @@ pub trait Component { fn ends<TZ:TimeZone>(&mut self, dt: DateTime<TZ>) -> &mut Self where TZ::Offset: fmt::Display { - self.add_property("DTEND", dt.format("%Y%m%dT%H%M%SZ").to_string().as_ref()); + // TODO don't manually use format but the rfc method, but test timezone behaviour + self.add_property("DTEND", dt.format("%Y%m%dT%H%M%S").to_string().as_ref()); self } |