zig/lib/std
Jonathan Marler 010ca69864
add functions to decode an epoch timestamp (#9040)
* add functions to decode an epoch timestamp

The code added here is alternative to the libc gmtime function. This function takes a unix epoch timestamp and decodes it into things like the year/day/time/etc. I looked at various libc implementations to see how it was implemented and this appears to be correct. I reorganized it so that applications can choose which data they need rather than calcualting it all in a single function. The data structures layout the order of operations required to decode various things like the year/month or time of day.

* set Month.jan to 1 instead of 0 to avoid +1 in conversion to numeric

* add another test

* remove unnecessary comptimeMod
2021-09-14 19:02:23 +03:00
..
atomic zig fmt: respect trailing commas in inline assembly 2021-08-29 11:57:32 +02:00
build stdlib: Add test for generating HEX files. 2021-09-01 12:21:30 -07:00
c os: usingnamespace fixes for std.x.os.Socket and std.os.TCP 2021-09-12 23:36:44 -04:00
compress remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
crypto fix missing paths (#9754) 2021-09-13 17:31:17 +02:00
dwarf std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
event openbsd: readapt event loop after usingnamespace changes 2021-09-08 13:40:43 -04:00
fmt remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fs std.os fixes to get the test suite passing again 2021-09-01 17:54:07 -07:00
hash remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
heap remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
io std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
json remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
math std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
mem remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
meta remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
net remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
os os: usingnamespace fixes for std.x.os.Socket and std.os.TCP 2021-09-12 23:36:44 -04:00
rand remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
special Fix building aarch64-windows-gnu by adding missing libc files and compiler_rt functions (#9555) 2021-09-07 19:44:21 +03:00
target compiler-rt: do not depend on usingnamespace 2021-08-12 10:48:54 -07:00
testing remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
Thread std.os: more reorganization efforts 2021-09-01 17:54:06 -07:00
time add functions to decode an epoch timestamp (#9040) 2021-09-14 19:02:23 +03:00
unicode remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
valgrind remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
x os: usingnamespace fixes for std.x.os.Socket and std.os.TCP 2021-09-12 23:36:44 -04:00
zig zig fmt: Keep callconv(.Inline) on function pointer types 2021-09-14 11:36:26 +02:00
array_hash_map.zig std.hash_map: add getKey methods (#9607) 2021-08-31 00:32:34 -04:00
array_list.zig std: publicize ArrayListUnmanaged.allocatedSlice to match ArrayList 2021-09-12 19:32:40 +03:00
ascii.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
atomic.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
base64.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
bit_set.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
bounded_array.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
buf_map.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
buf_set.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
build.zig Fix same issue with dir/sysroot dir concatenation with includes on Windows 2021-09-12 19:35:03 -04:00
builtin.zig std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
c.zig std.os fixes to get the test suite passing again 2021-09-01 17:54:07 -07:00
child_process.zig stdlib: fix ChildProcess.killPosix 2021-09-06 20:10:42 +03:00
coff.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
compress.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
comptime_string_map.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
crypto.zig reexport crypto/phc_encoding (#9712) 2021-09-09 14:25:44 +02:00
cstr.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
debug.zig std: fix regressions from this branch 2021-09-01 17:54:07 -07:00
dwarf.zig std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
dynamic_library.zig std.os: more reorganization efforts 2021-09-01 17:54:06 -07:00
elf.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
enums.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
event.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fifo.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fmt.zig std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
fs.zig std: dirent is not part of posix 2021-09-01 17:54:07 -07:00
hash.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
hash_map.zig std.hash_map: add StringIndexAdapter and StringIndexContext 2021-09-03 06:50:27 -07:00
heap.zig std: reorganization that allows new usingnamespace semantics 2021-09-01 17:54:06 -07:00
io.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
json.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
leb128.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
linked_list.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
log.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
macho.zig macho: fix allocating sections within segment when parsing objects 2021-08-31 23:05:01 +02:00
math.zig add functions to decode an epoch timestamp (#9040) 2021-09-14 19:02:23 +03:00
mem.zig zig fmt: respect trailing commas in inline assembly 2021-08-29 11:57:32 +02:00
meta.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
multi_array_list.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
net.zig std.os: more reorganization efforts 2021-09-01 17:54:06 -07:00
once.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
os.zig os: usingnamespace fixes for std.x.os.Socket and std.os.TCP 2021-09-12 23:36:44 -04:00
packed_int_array.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
pdb.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
priority_dequeue.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
priority_queue.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
process.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
Progress.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
rand.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
SemanticVersion.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
sort.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
start.zig stage2: implement Value.copy for structs and unions 2021-09-13 20:11:35 -07:00
start_windows_tls.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
std.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
target.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
testing.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
Thread.zig std.os reorg: regression fixes to stack_t, and std.Thread 2021-09-01 17:54:07 -07:00
time.zig add functions to decode an epoch timestamp (#9040) 2021-09-14 19:02:23 +03:00
unicode.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
valgrind.zig zig fmt: respect trailing commas in inline assembly 2021-08-29 11:57:32 +02:00
wasm.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
x.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
zig.zig plan9: change output executable name 2021-09-07 15:08:51 -04:00