authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-04-29 15:01:26 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-04-29 15:11:11 -07:00
logbbc0fc108ea25eda1058c343c17aa204adb0ec00
tree3691ed2017dcfd48e25e1092b54b6630bfab51ac
parent169ddf27878a69283270a891e82661bc70b79dda
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

add DateTime.to_timespec()


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

time.zig+7
......@@ -233,6 +233,13 @@ pub const DateTime = struct {
233233 return res;
234234 }
235235
236 pub fn to_timespec(self: DateTime) sys.struct_timespec {
237 return .{
238 .sec = self.toUnix(),
239 .nsec = self.ms * ns_per_ms,
240 };
241 }
242
236243 fn daysSinceEpoch(self: DateTime) u64 {
237244 var res: u64 = 0;
238245 res += self.days;