| ... | @@ -75,4 +75,8 @@ pub const ULID = struct { | ... | @@ -75,4 +75,8 @@ pub const ULID = struct { |
| 75 | pub fn stringifyJson(self: ULID, writer: anytype, options: std.json.Stringify.Options, json: type) !void { | 75 | pub fn stringifyJson(self: ULID, writer: anytype, options: std.json.Stringify.Options, json: type) !void { |
| 76 | return json.stringify(writer, &self.bytes(), options); | 76 | return json.stringify(writer, &self.bytes(), options); |
| 77 | } | 77 | } |
| | 78 | |
| | 79 | pub fn createdAt(self: ULID, epoch: u64) time.DateTime { |
| | 80 | return .initUnixMs(epoch + self.timestamp); |
| | 81 | } |
| 78 | }; | 82 | }; |