mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-11-07 14:17:18 +00:00
Two ways the clock read hours off while the zone setting looked right. The ESP32-P4 esp-hosted boards started SNTP with configTime(0, 0, ...), which also sets TZ to UTC, so from the first Wi-Fi join every displayed time was UTC until the zone was picked again. #756 fixed this on the T-Display P4; the CrowPanel P4 10.1 still had it. It now starts SNTP with the user's zone (configTzTime) and, as on the T-Display, only pushes a COMPLETED sync into the clock instead of the stale boot time. Settings > Clock & time fills "By hand (local time)" with the clock's reading when the page opens. Picking another zone (or stepping the custom offset) left those digits in the old zone, so "Set clock" right after a zone change read them in the new zone and moved the clock by the difference. The field now refills whenever the zone is applied. The zone table and its POSIX strings move to helpers/TimeZones.h (same strings, same order) so test/test_time_zones.cpp can check every zone through the C library's localtime(): January, July and today's offsets, the US and EU DST edges to the minute, the Custom offset's sign for UTC-12..+14, and ClockFloorRTC with the zone in force (a later clock set, like the GPS re-sync every 30 minutes, moves the time and never the zone; a chip that reads behind the floor or garbage-future falls back to the system clock). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>