wallet: chatview switch timestamp from millis to secs

This commit is contained in:
darkfi
2024-08-05 15:36:04 +02:00
parent 3aeec3d861
commit 62b2cd6276
2 changed files with 3 additions and 3 deletions

View File

@@ -754,7 +754,7 @@ fn populate_tree(tree: &sled::Tree) {
let min = min.parse::<u32>().unwrap();
let dt: NaiveDateTime =
NaiveDate::from_ymd_opt(2024, 8, 6).unwrap().and_hms_opt(hour, min, 0).unwrap();
let timest = dt.and_utc().timestamp_millis() as u64;
let timest = dt.and_utc().timestamp() as u64;
let message_id = [0u8; 32];
let nick = parts[1].to_string();

View File

@@ -639,7 +639,7 @@ impl ChatView {
let chatmsg = ChatMsg { nick, text };
let dt = Local.timestamp_millis_opt(timest as i64).unwrap();
let dt = Local.timestamp_opt(timest as i64, 0).unwrap();
let timestr = dt.format("%H:%M").to_string();
let text = format!("{} {} {}", timestr, chatmsg.nick, chatmsg.text);
@@ -822,7 +822,7 @@ impl ChatView {
let chatmsg: ChatMsg = deserialize(&v).unwrap();
debug!(target: "ui::chatview", "{timest:?} {chatmsg:?}");
let dt = Local.timestamp_millis_opt(timest as i64).unwrap();
let dt = Local.timestamp_opt(timest as i64, 0).unwrap();
let timestr = dt.format("%H:%M").to_string();
let text = format!("{} {} {}", timestr, chatmsg.nick, chatmsg.text);