0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib
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
History 2021-09-14 19:02:23 +03:00
..
include llvm12: sync with llvmorg-12.0.0-rc2 2021-02-26 13:44:33 -08:00
libc changes to build zig-bootstrap aarch64-windows 2021-09-07 14:27:50 -06:00
libcxx dragonfly: port libc++ 2021-08-21 15:17:08 +03:00
libcxxabi llvm12: sync with llvmorg-12.0.0-rc2 2021-02-26 13:44:33 -08:00
libunwind llvm12: sync with llvmorg-12.0.0-rc2 2021-02-26 13:44:33 -08:00
std add functions to decode an epoch timestamp (#9040) 2021-09-14 19:02:23 +03:00
tsan stage2: fix Cache deadlock and build more of TSAN 2020-12-24 01:18:48 -07:00