Skip to content

[Bug]: Cron scheduler timestamp calculation bug - year rollback #30351

@yidong2865

Description

@yidong2865

Summary

Bug Description

2
3 The cron scheduler calculates the wrong year for nextRunAtMs, causing tasks to never trigger.
4
5 ## Environment
6
7 - OpenClaw version: 2026.2.13
8 - OS: Linux 6.8.0-55-generic (x64)
9 - Node.js: v22.22.0
10 - Timezone: Asia/Shanghai
11
12 ## Steps to Reproduce
13
14 1. Create a cron job:
15 ```json
16 {
17 "schedule": {
18 "kind": "cron",
19 "expr": "0 8 * * *",
20 "tz": "Asia/Shanghai"
21 }
22 }

Steps to reproduce

Run openclaw cron list
Check the nextRunAtMs field

Expected behavior

nextRunAtMs should be March 2, 2026 08:00:00 (tomorrow morning).

Actual behavior

Current time: March 1, 2026
nextRunAtMs: 1772409600000 = March 1, 2025 (one year ago) Since the scheduler thinks the next run time is in the past, it never triggers the job.

OpenClaw version

2026.2.13

Operating system

Linux 6.8.0-55-generic(x64)za

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions