Permalink
Browse files

fix issue #213 iso date format inversion

  • Loading branch information...
Alfred Sawaya
Alfred Sawaya committed Aug 6, 2017
1 parent ec47269 commit fca5b6b97082c74844fd70f1729561da9b3fbbb8
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/output/time.rs
@@ -170,28 +170,28 @@ impl ISOFormat {
let date = LocalDateTime::at(time.seconds as i64);
if self.is_recent(date) {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
else {
format!("{:02}-{:02} {:02}:{:02}",
date.month() as usize, date.day(),
date.hour(), date.minute())
}
else {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
}
#[allow(trivial_numeric_casts)]
fn format_zoned(&self, time: Time, zone: &TimeZone) -> String {
let date = zone.to_zoned(LocalDateTime::at(time.seconds as i64));
if self.is_recent(date) {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
else {
format!("{:02}-{:02} {:02}:{:02}",
date.month() as usize, date.day(),
date.hour(), date.minute())
}
else {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
}
}

0 comments on commit fca5b6b

Please sign in to comment.