Commit Graph
9 Commits
Author SHA1 Message Date
waozi 37a64372a6 Add target-aware package application APIs 2026-11-13 04:20:48 -03:00
waozi 7442b5886f Use native Windows clocks for shared account and package hosts 2026-10-22 19:18:27 -03:00
waozi 455fd582ca Read any IANA time zone's UTC offset with ZoneOffsetAt
ZoneOffsetAt(zone, seconds) gives the offset of a zone such as Asia/Tokyo
at a moment, for world clocks. Native builds switch libc's TZ for one
reading and restore it, refusing names glibc's database lacks; web builds
ask the browser through Intl.DateTimeFormat's longOffset. Names are
limited to IANA characters and cannot leave the zone database.
tests/date_time_linux.sh checks whole, half and quarter hour zones, DST,
unknown names and the restored TZ natively and under node.
2026-10-13 23:43:47 -03:00
waozi a677e9530b Read the clock with Emscripten's 64-bit time_t in web builds
On wasm32 Emscripten's time_t is 64-bit while long stays 32-bit. The
pointer-sized time() binding was a linker signature mismatch that trapped
on the first call, so a web page reading the local time froze (Werkzeug's
Clock), and clock_gettime wrote a 16-byte timespec into an 8-byte struct,
leaving the monotonic clock at whole seconds. PLATFORM_WEB builds now use
64-bit seconds and Emscripten's timespec layout. tests/date_time_linux.sh
checks both modules' layouts against Emscripten's time.h, links with fatal
linker warnings and runs the clocks under node when emcc is available.
2026-10-13 23:23:06 -03:00
waozi ea9d6254ad Read the wall clock with long-sized fields on 32-bit Android
std/date_time_linux declared time_t, struct timespec and tm_gmtoff as
64-bit, but they are long-sized and 32-bit on armeabi-v7a.
UnixMilliseconds returned -1 there, so a 32-bit phone saw the epoch:
Werkzeug's Auth showed the code for 1970 on a Moto e6 play. They now use
isize like std/timer_linux, and seconds a 32-bit time_t cannot hold give
an invalid date. tests/date_time_linux.sh checks the layouts against
time.h, also for armv7a and aarch64 Android when ZIRAN_THREAD_ANDROID_NDK
is set.
2026-10-13 02:17:39 -03:00
waozi 5a2a5cd955 Keep native clock providers distinct from portable date/time 2026-10-02 14:52:37 -03:00
waozi 29f3638fe5 Expose millisecond epoch timestamps for native clocks 2026-09-30 16:55:59 -03:00
waozi f0af42d16a Add native civil clocks and portable Gregorian calendars 2026-09-30 11:44:41 -03:00
waozi 78d46d26a8 Add native Ziran data and HTTP modules 2026-09-25 15:32:13 -03:00