diff --git a/src/matrix_harness.zig b/src/matrix_harness.zig index f89b36a..a468538 100644 --- a/src/matrix_harness.zig +++ b/src/matrix_harness.zig @@ -561,13 +561,19 @@ pub fn main(init: std.process.Init) !void { if (!std.mem.eql(u8, ev.sender, peer)) continue; if (ev.body.len == 0) continue; - var ts_buf: [16]u8 = undefined; + var ts_buf: [24]u8 = undefined; const ts_str: []const u8 = blk: { if (ev.ts <= 0) break :blk ""; const secs: u64 = @intCast(@divTrunc(ev.ts, 1000)); const epoch = std.time.epoch.EpochSeconds{ .secs = secs }; + const day = epoch.getEpochDay(); + const year_day = day.calculateYearDay(); + const month_day = year_day.calculateMonthDay(); const sod = epoch.getDaySeconds(); - break :blk std.fmt.bufPrint(&ts_buf, " {d:0>2}:{d:0>2}Z", .{ sod.getHoursIntoDay(), sod.getMinutesIntoHour() }) catch ""; + break :blk std.fmt.bufPrint(&ts_buf, " {d:0>4}-{d:0>2}-{d:0>2} {d:0>2}:{d:0>2}Z", .{ + year_day.year, month_day.month.numeric(), month_day.day_index + 1, + sod.getHoursIntoDay(), sod.getMinutesIntoHour(), + }) catch ""; }; // Attachment: download locally and forward the path to the agent.