-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
cron: --at ignores --tz flag, bare ISO datetimes default to UTC #53218
Description
Bug
openclaw cron add --at '2026-03-23T23:00:00' --tz Europe/Oslo schedules the job at 23:00 UTC, not 23:00 Oslo time. The --tz flag is silently ignored for --at jobs.
Expected behavior
If --tz is provided, bare ISO datetimes (without offset) should be interpreted in that timezone. If no --tz is provided, the system timezone or a sensible default should apply.
Current behavior
parseAt() passes the input to parseAbsoluteTimeMs() → new Date(), which treats offset-less ISO strings as UTC. The --tz flag only applies to cron expressions (line 354: *"--stagger/--exact/--tz are only valid for cron schedules"*).
Workaround
Include the UTC offset explicitly: --at '2026-03-23T23:00:00+01:00'
Suggested fix
- When
--tzis provided with--at, use it to interpret the datetime - Or: when the input has no offset, apply the system's local timezone instead of UTC
- At minimum: update the help text for
--atto say *"ISO with offset, or +duration. Bare datetimes are treated as UTC; use offset like +01:00 for local time"*
Impact
Reminders/one-shot jobs fire at the wrong time. Users assume their local timezone applies (natural expectation), and the job runs 1-2 hours off.