From 30534c27c9d70509859cc93d78e5c7aefd6a01b1 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 6 Nov 2014 17:24:56 -0800 Subject: [PATCH] dont convert Date to utc if already utc Part of #98 --- src/header/common/date.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/header/common/date.rs b/src/header/common/date.rs index 9342be34..91d18f38 100644 --- a/src/header/common/date.rs +++ b/src/header/common/date.rs @@ -30,7 +30,10 @@ impl fmt::Show for Date { let Date(ref tm) = *self; // bummer that tm.strftime allocates a string. It would nice if it // returned a Show instead, since I don't need the String here - write!(fmt, "{}", tm.to_utc().rfc822()) + match tm.tm_gmtoff { + 0 => tm.rfc822().fmt(fmt), + _ => tm.to_utc().rfc822().fmt(fmt) + } } }