FM-014 Time, State, and API Lifecycle

Timezone and Daylight-Saving-Time Failures

Scheduled tasks run an hour early, late, or twice because the API stores times without clear timezone semantics across DST boundaries.

Failure explanation

An API stores, converts, compares, or schedules date/time values incorrectly across time zones and daylight-saving transitions. Local wall-clock times can be ambiguous when clocks move backward and nonexistent when clocks move forward. Treating a local timestamp as UTC, storing only an offset, or applying current timezone rules to historical dates can shift appointments or trigger jobs twice.

Example

A customer schedules a daily report for 08:00 in America/Los_Angeles. The service stores a fixed UTC offset rather than the timezone identifier. After daylight-saving time begins, the report runs at 09:00 local time.

How to test

  • Test DST spring-forward and fall-back transitions in representative zones.
  • Test ambiguous/nonexistent local times, leap days, month boundaries, and recurring schedules.
  • Verify UTC instants and IANA timezone identifiers are handled distinctly.
  • Use a controllable clock instead of waiting for real calendar events.

Expected behavior

The API defines whether values represent an instant, a local date/time, or a recurring local schedule. Conversion and ambiguity policies are explicit and deterministic.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.