authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:36:05 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:36:05 -07:00
log6947fa581e7fdb447e06d1a0444af3a60d38f5d1
tree1e4a33ba6e0a2530143d11e60a6b3325297195a6
parentf9a433b782d15b6526af2faf3e222eb4efe7f6cd

add DateTime.initUnix that accepts seconds


1 files changed, 4 insertions(+), 0 deletions(-)

time.zig+4
......@@ -19,6 +19,10 @@ pub const DateTime = struct {
1919 return unix_epoch.addMs(unix);
2020 }
2121
22 pub fn initUnix(unix: u64) Self {
23 return unix_epoch.addSecs(unix);
24 }
25
2226 /// Caller asserts that this is > epoch
2327 pub fn init(year: u16, month: u16, day: u16, hr: u16, min: u16, sec: u16) Self {
2428 return unix_epoch