Skip to content

Time zone issue on Date #50565

Closed
Closed
@devinjohw

Description

Version

v20.9.0

Platform

Darwin Devins-MacBook-Air-m2-2022.local 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:57 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8112 arm64

Subsystem

No response

What steps will reproduce the bug?

  1. Set your time zone of your macOS to Aisa/Shanghai with command sudo systemsetup -settimezone Asia/Shanghai
  2. Create a simple script timezone.js that contains the code console.log(new Date().toString().
  3. Run the script with command node timezone.js
  4. This Output would display on the terminal
    Mon Nov 06 2023 00:19:33 GMT+0800 (Central Standard Time)

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

The name of time zone in China is China Standard Time instead of Central Standard Time, the exprected output should be: Mon Nov 06 2023 00:19:33 GMT+0800 (China Standard Time)

What do you see instead?

This Output would display on the terminal
Mon Nov 06 2023 00:19:33 GMT+0800 (Central Standard Time)

Additional information

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions