Convert dates to local time.

This commit is contained in:
2019-01-22 11:29:34 +01:00
parent 0e32e8fa9c
commit b163e3c0fc

View File

@@ -1,6 +1,6 @@
use std::fmt;
use chrono::{DateTime, Utc};
use chrono::{DateTime, Local, Utc};
mod eniro;
mod hitta;
@@ -56,10 +56,12 @@ pub struct Comment {
impl fmt::Display for Comment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let datetime = self.datetime.with_timezone(&Local);
write!(
f,
"{}: {} - {}",
self.datetime.format("%Y-%m-%d %H:%M:%S"),
datetime.format("%Y-%m-%d %H:%M:%S"),
self.title,
self.message
)