mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
std.time.epoch: Fix comments referring to epoch as 1970-10-01
This commit is contained in:
parent
8e91c229e1
commit
708414aaf4
2 changed files with 2 additions and 3 deletions
1
lib/compiler/aro/aro/Compilation.zig
vendored
1
lib/compiler/aro/aro/Compilation.zig
vendored
|
|
@ -217,7 +217,6 @@ fn generateDateAndTime(w: anytype, timestamp: u47) !void {
|
|||
});
|
||||
|
||||
const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
|
||||
// days since Thu Oct 1 1970
|
||||
const day_name = day_names[@intCast((epoch_day.day + 3) % 7)];
|
||||
try w.print("#define __TIMESTAMP__ \"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"\n", .{
|
||||
day_name,
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ pub const MonthAndDay = struct {
|
|||
day_index: u5, // days into the month (0 to 30)
|
||||
};
|
||||
|
||||
// days since epoch Oct 1, 1970
|
||||
/// days since epoch Jan 1, 1970
|
||||
pub const EpochDay = struct {
|
||||
day: u47, // u47 = u64 - u17 (because day = sec(u64) / secs_per_day(u17)
|
||||
pub fn calculateYearDay(self: EpochDay) YearAndDay {
|
||||
|
|
@ -168,7 +168,7 @@ pub const DaySeconds = struct {
|
|||
}
|
||||
};
|
||||
|
||||
/// seconds since epoch Oct 1, 1970 at 12:00 AM
|
||||
/// seconds since epoch Jan 1, 1970 at 12:00 AM
|
||||
pub const EpochSeconds = struct {
|
||||
secs: u64,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue