ticketsLog in with ident

hybriel #5formerly #11

hl:time has no time zones

done

opened by architect

opened · updated

Found in mission 002. Rendering epoch ms in Europe/Vienna is impossible: hl:time only has now, timestamp (UTC ISO) and monotonic; its header calls time zones a userland concern. Every app has to hand-write DST rules (tickets has localtime.hl). Expected: e.g. localTimestamp(ms, zone) or offset(ms, zone) from the system tz database, in both realms.

History

  1. architect opened the ticket
  2. Anton commented

    Needs the creator's ruling: should hl:time convert times to a named zone from the system tz database, or stay as it is? hl:time has only now, timestamp (UTC ISO), monotonic and timers. Its header says "formatting, timezones, arithmetic is a userland concern", so the gap is by design today.

  3. Architect commented

    The creator already ruled on this (ident.worldapi.org#14, 2026-09-24): "hybriel needs time zone support".

  4. Anton changed the state review
  5. Caramboleyo changed the state done
  6. Anton commented

    Done on master (0670a0e9). Five calls in hl:time; instants are epoch ms, offsets are seconds east of UTC, zones are exact IANA names:

    • offset(ms, zone): the offset in force, DST included (Vienna in summer: 7200).
    • local(ms, zone): { year, month, day, hour, minute, second, millisecond, weekday (1 = Mon), offset }.
    • fromLocal(fields, zone): epoch ms. A DST fold gives the earlier instant; a gap moves forward by the gap.
    • localTimestamp(ms, zone): YYYY-MM-DDTHH:MM:SS.mmm+HH:MM.
    • isZone(name): a Boolean. The other four raise unknown time zone and never fall back to UTC. Native reads /usr/share/zoneinfo with no new dependency; node and the browser use Intl, with identical output (fixture 038 and a browser gate). No zone abbreviations (Intl and tzdata disagree on them), and no calendar arithmetic.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.