Convert dates to local time.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Local, Utc};
|
||||||
|
|
||||||
mod eniro;
|
mod eniro;
|
||||||
mod hitta;
|
mod hitta;
|
||||||
@@ -56,10 +56,12 @@ pub struct Comment {
|
|||||||
|
|
||||||
impl fmt::Display for Comment {
|
impl fmt::Display for Comment {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
let datetime = self.datetime.with_timezone(&Local);
|
||||||
|
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"{}: {} - {}",
|
"{}: {} - {}",
|
||||||
self.datetime.format("%Y-%m-%d %H:%M:%S"),
|
datetime.format("%Y-%m-%d %H:%M:%S"),
|
||||||
self.title,
|
self.title,
|
||||||
self.message
|
self.message
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user