diff --git a/time.zig b/time.zig index a2453766ff0d844e3b97d01e7e6c2c43e2131075..b92dc42aaf297f6ba9dc6da4f5d3aace54faaf67 100644 --- a/time.zig +++ b/time.zig @@ -426,9 +426,9 @@ pub const DateTime = struct { X, // unix }; - pub fn since(self: DateTime, other_in_the_past: DateTime) Duration { + pub fn since(self: DateTime, other: DateTime) Duration { return Duration{ - .ms = self.toUnixMilli() - other_in_the_past.toUnixMilli(), + .ms = @as(i64, @intCast(self.toUnixMilli())) - @as(i64, @intCast(other.toUnixMilli())), }; } @@ -548,7 +548,7 @@ fn toTuple(array: anytype) @Tuple(&@as([array.len]type, @splat(std.meta.Child(@T } pub const Duration = struct { - ms: u64, + ms: i64, }; // Divisions of a nanosecond.