Skip to content

Clock: optional tz.library support for a DST-aware UTC-offset guess #89

Description

@sidick

docs/CLOCK.md seeds the amber UTC-offset guess from locale.library's loc_GMTOffset, and its documented weaknesses are exactly the ones a real timezone database fixes: no DST awareness, and a fixed offset that goes stale twice a year.

The IANA tz database has a maintained classic-Amiga port — "Timezone Database & Library" (Aminet util/time/tz.lha v7.18 / tz8.lha v8.20, dev package tzdev.lha) — providing tz.library with full tzdata, i.e. DST-correct local→UTC conversion. Precedent in our exact niche: AmiAuthenticator (Aminet util/wb/AmiAuthenticator) already offers it as one of its three time sources.

Proposal:

  • At clock init, runtime-detect tz.library. When present and configured, derive the local→UTC offset from it instead of loc_GMTOffset.
  • Still amber, not green — tzdata fixes the offset, but the underlying RTC can still be wrong. SNTP remains the only path to CLOCK_SYNCED, and the manual nudge still applies on top.
  • Fallback chain becomes: SNTP → tz.library → loc_GMTOffset → manual nudge.
  • Never required — the zero-mandatory-deps rule applies. Same optional runtime-dispatched provider pattern as AmiSSL (Optional AmiSSL-backed crypto provider (CRYPTO=BUILTIN|AMISSL|AUTO) #85).
  • Mind the sign conventions: CLOCK.md already flags the loc_GMTOffset minutes-west footgun; verify tz.library's convention independently rather than assuming it matches.

Wiki: the clock/time-sources page gets the new source and priority order when this lands.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestparkedResearched and deliberately deferred; revisit if circumstances change

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions