Skip to content

Broken default timezone #971

Closed
Closed
@verside2

Description

@verside2

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

  1. sudo timedatectl set-timezone Europe/Moscow
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions