Skip to content

Commit 708414a

Browse files
linusgandrewrk
authored andcommitted
std.time.epoch: Fix comments referring to epoch as 1970-10-01
1 parent 8e91c22 commit 708414a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/compiler/aro/aro/Compilation.zig

-1
Original file line numberDiff line numberDiff line change
@@ -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
Original file line numberDiff line numberDiff line change
@@ -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
137137
pub 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
172172
pub const EpochSeconds = struct {
173173
secs: u64,
174174

0 commit comments

Comments
 (0)