Switch to defined constant when converting between s/ms/ns
This commit is contained in:
parent
c95ac51e05
commit
8af6341f95
1 changed files with 1 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ const Data = @import("types.zig");
|
|||
|
||||
pub fn dateFmt(allocator: std.mem.Allocator, epoch: i64) ![]const u8 {
|
||||
var date = std.ArrayList(u8).init(allocator);
|
||||
try (try zeit.instant(.{ .source = .{ .unix_timestamp = @divFloor(epoch, 1_000_000) } })).time().strftime(date.writer(), "%d %b %Y, %H:%M");
|
||||
try (try zeit.instant(.{ .source = .{ .unix_timestamp = @divFloor(epoch, std.time.ns_per_s) } })).time().strftime(date.writer(), "%d %b %Y, %H:%M");
|
||||
return date.items;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue