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 {...@@ -217,7 +217,6 @@ fn generateDateAndTime(w: anytype, timestamp: u47) !void {
217 });217 });
218218
219 const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };219 const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
220 // days since Thu Oct 1 1970
221 const day_name = day_names[@intCast((epoch_day.day + 3) % 7)];220 const day_name = day_names[@intCast((epoch_day.day + 3) % 7)];
222 try w.print("#define __TIMESTAMP__ \"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"\n", .{221 try w.print("#define __TIMESTAMP__ \"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"\n", .{
223 day_name,222 day_name,
lib/std/time/epoch.zig+2-2
...@@ -133,7 +133,7 @@ pub const MonthAndDay = struct {...@@ -133,7 +133,7 @@ pub const MonthAndDay = struct {
133 day_index: u5, // days into the month (0 to 30)133 day_index: u5, // days into the month (0 to 30)
134};134};
135135
136// days since epoch Oct 1, 1970136/// days since epoch Jan 1, 1970
137pub const EpochDay = struct {137pub const EpochDay = struct {
138 day: u47, // u47 = u64 - u17 (because day = sec(u64) / secs_per_day(u17)138 day: u47, // u47 = u64 - u17 (because day = sec(u64) / secs_per_day(u17)
139 pub fn calculateYearDay(self: EpochDay) YearAndDay {139 pub fn calculateYearDay(self: EpochDay) YearAndDay {
...@@ -168,7 +168,7 @@ pub const DaySeconds = struct {...@@ -168,7 +168,7 @@ pub const DaySeconds = struct {
168 }168 }
169};169};
170170
171/// seconds since epoch Oct 1, 1970 at 12:00 AM171/// seconds since epoch Jan 1, 1970 at 12:00 AM
172pub const EpochSeconds = struct {172pub const EpochSeconds = struct {
173 secs: u64,173 secs: u64,
174174