Display local time instead of UTC

Fixes #39.
This commit is contained in:
Julian Schmidhuber
2026-01-07 15:56:21 +01:00
parent 3a4acc2d12
commit 66a3634a71

View File

@ -2,7 +2,7 @@ use std::io::Read;
use adw::prelude::*;
use adw::subclass::prelude::*;
use chrono::NaiveDateTime;
use chrono::{Local, TimeZone};
use gtk::{gdk, gio, glib};
use ntfy_daemon::models;
use tracing::error;
@ -50,7 +50,9 @@ impl MessageRow {
let time = gtk::Label::builder()
.label(
&NaiveDateTime::from_timestamp_opt(msg.time as i64, 0)
&Local
.timestamp_opt(msg.time as i64, 0)
.earliest()
.map(|time| time.format("%Y-%m-%d %H:%M:%S").to_string())
.unwrap_or_default(),
)