Skip to content

P1: Evaluate schedule cron in local timezone (config override) #166

Closed

Description

@chinkan

Problem

Scheduled cron expressions are evaluated in UTC (Job::new_async → Utc). Users typing 0 9 * * * (or 5-field 0 9 * * *) mean 09:00 in their local time, not 09:00 UTC. For Hong Kong (UTC+8) that fires at 17:00 HKT — a product bug.

Decision (PO 2026-10-06)

Scope (for upcoming ADR)

  • Document timezone source of truth (system default + config override).
  • Apply to portal tasks, schedule_task tool, and config crons.
  • Migration / display: API and portal should show which timezone the expression uses.
  • Tests: a 09:00 local expression fires at 09:00 local, not UTC.

Out of scope

Notion

P1 row: schedule uses local timezone (board).

Related: ADR-0021 on PR #165.

Activity

  1. chinkan commented on Oct 6, 2026

    @chinkan
    OwnerAuthor

    TL notes for the upcoming timezone ADR (research facts, 2026-10-06):

    1. croner 4 already supports timezones: find_next_occurrence takes DateTime<Tz>. Prefer passing chrono Local or a chrono_tz::Tz rather than hand-rolling offsets. Config override should parse IANA names via chrono-tz (e.g. Asia/Hong_Kong).
    2. "System local" is unreliable in Docker: containers without /etc/localtime (or TZ) often default to UTC and reproduce the 09:00→17:00 HKT bug. ADR should require boot log of the effective timezone, and document that Docker users must set config override and/or TZ.
    3. DST: Hong Kong has no DST; other users do. Ambiguous/skipped local times need an explicit fire-once vs skip rule (PO lock when ADR is written).

    Does not block #155 / ADR-0021.

  2. chinkan commented on Oct 6, 2026

    @chinkan
    OwnerAuthor

    PO locks for #166 (2026-10-06) — ready for ADR when scheduled:

    DST

    • Skipped local time (e.g. 02:30 does not exist during spring forward): fire once immediately after the clock jump. Reminders must not disappear.
    • Ambiguous local time (falls back / occurs twice): fire once, using the first occurrence.

    AC (UI)

    • Portal Tasks page must show the effective timezone currently in use. Boot log alone is not enough (non-technical users will not read logs).

    Still does not block #155.

  3. chinkan commented on Oct 6, 2026

    @chinkan
    OwnerAuthor

    ADR-0022 (Accepted) is up for review in #168: #168

    It records the PO locks from 2026-10-06: system local timezone by default, [general] timezone IANA override, a per-task timezone column with existing rows stamped UTC (option C), effective timezone shown in the boot log and on the portal Tasks page, and the DST fire-once rules. It also covers removing the temporary UTC hints in the portal and the schedule_task description. Docs only; implementation comes in a follow-up PR.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions