Skip to content

[Bug] Cron jobs run at wrong time without explicit timezone #8399

@tehoro

Description

@tehoro

Summary

Cron jobs are persisted in ~/.openclaw/cron/jobs.json but appear to run at wrong times when created without explicit timezone in schedule object.

Steps to reproduce

  1. Create a cron job with cron add using an expression like "0 13 * * *" without tz field
  2. Expected: job runs at 13:00 local time (Pacific/Auckland)
  3. Actual: job runs at 13:00 UTC (02:00 local time next day)

Evidence

Jobs persisted in ~/.openclaw/cron/jobs.json showed:

{
  "schedule": {
    "expr": "0 13 * * *",
    "kind": "cron"
  }
}

Without tz field, expression defaults to UTC, causing confusion when job appears in list but runs at wrong time.

Jobs affected

  • Aurora Forecast 13:00 NZT (id: b642bacf-...) - was running at 02:00 NZT instead of 13:00
  • Aurora Forecast 17:00 NZT (id: c11e8437-...) - same issue

Fix applied

Added tz: "Pacific/Auckland" to schedule object.

Expected behavior

  • Cron tool should either require explicit timezone or default to system timezone
  • Documentation should be explicit about timezone behavior
  • Jobs created without tz should warn or require confirmation

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions