From d8ee58452c83d1e6160babb5736a78b453fc2f13 Mon Sep 17 00:00:00 2001 From: wyhaya Date: Thu, 6 Jun 2019 11:14:59 +0800 Subject: [PATCH] Add '0' to RFC2822 --- src/format/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/format/mod.rs b/src/format/mod.rs index bd8337ba00..a0ca64b781 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -511,7 +511,7 @@ pub fn format<'a, I>(w: &mut fmt::Formatter, date: Option<&NaiveDate>, time: Opt RFC2822 => // same to `%a, %e %b %Y %H:%M:%S %z` if let (Some(d), Some(t), Some(&(_, off))) = (date, time, off) { let sec = t.second() + t.nanosecond() / 1_000_000_000; - try!(write!(w, "{}, {:2} {} {:04} {:02}:{:02}:{:02} ", + try!(write!(w, "{}, {:02} {} {:04} {:02}:{:02}:{:02} ", SHORT_WEEKDAYS[d.weekday().num_days_from_monday() as usize], d.day(), SHORT_MONTHS[d.month0() as usize], d.year(), t.hour(), t.minute(), sec));