| author | |
| committer | |
| log | 92e685c09cb549fb128ed8d01ebb316b2e371b97 |
| tree | e1f13279f4df0800d8ed7125d84f1c46863365ad |
| parent | dcca09510f26fa26ccba55828199a83583714560 |
| signature | Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw |
1 files changed, 6 insertions(+), 0 deletions(-)
time.zig+6| ... | ... | @@ -46,6 +46,12 @@ pub const DateTime = struct { |
| 46 | 46 | return initUnixMs(@intCast(milliTimestamp())); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | pub fn nowAtOffset(offset: i8) DateTime { | |
| 50 | var result: DateTime = .initUnixMs(@intCast(milliTimestamp() + (@as(i64, offset) * 15 * ms_per_min))); | |
| 51 | result.z_offset = offset; | |
| 52 | return result; | |
| 53 | } | |
| 54 | ||
| 49 | 55 | pub const epoch_unix = DateTime{ |
| 50 | 56 | .ms = 0, |
| 51 | 57 | .seconds = 0, |