From 56d2be5b73a82a3973d1060fc72734da665e485e Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Tue, 28 Jul 2026 04:54:41 -0700 Subject: [PATCH] add createdAt --- ulid.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ulid.zig b/ulid.zig index 1dd4546ab0c1dd01456ba1a7aa351eae02a10cb7..84fdc64f0b3f566ce0649abf9b0d6413fe398e90 100644 --- a/ulid.zig +++ b/ulid.zig @@ -75,4 +75,8 @@ pub const ULID = struct { pub fn stringifyJson(self: ULID, writer: anytype, options: std.json.Stringify.Options, json: type) !void { return json.stringify(writer, &self.bytes(), options); } + + pub fn createdAt(self: ULID, epoch: u64) time.DateTime { + return .initUnixMs(epoch + self.timestamp); + } }; -- 2.54.0