Closed
Description
Description
The documentation says:
timeZone: [OPTIONAL] - Sets the execution time zone. Default is local time.
But starting from version 4.1.1, this is not the case. UTC is probably used by default.
Expected Behavior
new CronJob("1 0 * * *", () => console.log(1)).start(); // should start at 00:01 on local zone
Actual Behavior
new CronJob("1 0 * * *", () => console.log(1)).start(); // starts at 03:01 on local zone
Possible Fix
No response
Steps to Reproduce
sudo timedatectl set-timezone Europe/Moscow
- run
new CronJob("1 0 * * *", () => console.log(1)).start()
Context
> timedatectl
Local time: Fri 2025-03-28 11:12:05 MSK
Universal time: Fri 2025-03-28 08:12:05 UTC
RTC time: Fri 2025-03-28 08:12:05
Time zone: Europe/Moscow (MSK, +0300)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no
Your Environment
cron
version: 4.1.1- NodeJS version: 22.14.0
- Operating System and version: Ubuntu 24.04.2 LTS