authorgravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2024-08-15 19:19:53+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-15 17:54:27-07:00
log708414aaf4d88157153cf413137d2cb3c106c3b4
treed1f9acfd41531b90737a0fd5c714743fe181861f
parent8e91c229e1538a32532f69d96c162d81f6ea771a

std.time.epoch: Fix comments referring to epoch as 1970-10-01


2 files changed, 2 insertions(+), 3 deletions(-)

lib/compiler/aro/aro/Compilation.zig-1
......@@ -217,7 +217,6 @@ fn generateDateAndTime(w: anytype, timestamp: u47) !void {
217217 });
218218
219219 const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
220 // days since Thu Oct 1 1970
221220 const day_name = day_names[@intCast((epoch_day.day + 3) % 7)];
222221 try w.print("#define __TIMESTAMP__ \"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"\n", .{
223222 day_name,
lib/std/time/epoch.zig+2-2
......@@ -133,7 +133,7 @@ pub const MonthAndDay = struct {
133133 day_index: u5, // days into the month (0 to 30)
134134};
135135
136// days since epoch Oct 1, 1970
136/// days since epoch Jan 1, 1970
137137pub const EpochDay = struct {
138138 day: u47, // u47 = u64 - u17 (because day = sec(u64) / secs_per_day(u17)
139139 pub fn calculateYearDay(self: EpochDay) YearAndDay {
......@@ -168,7 +168,7 @@ pub const DaySeconds = struct {
168168 }
169169};
170170
171/// seconds since epoch Oct 1, 1970 at 12:00 AM
171/// seconds since epoch Jan 1, 1970 at 12:00 AM
172172pub const EpochSeconds = struct {
173173 secs: u64,
174174