Skip to content

node process does not reflect timezone changes #33805

@aghArdeshir

Description

@aghArdeshir
  • Version: 12.17.0
  • Platform: Linux 5.4.0-33-generic # 37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Platform: Linux 3.16.0-4.9-amd64 # 1 SMP Debian 3.16.7-ckt25-1 (2018-11-21) x86_64 GNU/Linux
    (it reproduces on both platforms)
  • Subsystem: ?

What steps will reproduce the bug?

  • open two terminals locally on machine
  • run node on terminal 1
  • new Date().getTimezoneOffset()
  • change timezone in terminal 2
  • ask for new Date().getTimezoneOffset() in node in terminal 1 again
  • note that timezone change is not reflected
  • exit node process in terminal 1 and enter node again (another node process)
  • now new Date().getTimezoneOffset() reflects the new timezone
  • note that this not-reflecting-new-timezone thing affects creating new dates and any other date operations. getTimezoneOffset() is just a sample

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

always reproduces, no required condition.

What is the expected behavior?

To reflect and update timezone of node process, when timezone of system is changed.

What do you see instead?

I see the old timezone.

Additional information

This bug has been created and reported previously, as I read, some people mentioned that the main bug is with V8, and linked to some bugs there. By the way, all previous reported bugs were closed. I link to everything I found here:
#4022
#20026
#19974
#3449

I created this issue as some time has passed and honestly, I couldn't find out why the previous issues were closed, and V8 discussions were beyond my knowledge.

What is the matter?

We have a system, a rather big one, composed of different programming languages and technologies, all components of our system works fine when timezone changes, except nodejs. There are solutions like https://github.com/evanlucas/reset-date-cache, but suppose node queries sql queries and created date objects from timestamps in sql tables, and timezone needs to be kept updated. the only way to keep it updated is to reset cache on each page request, which as noted in https://github.com/evanlucas/reset-date-cache:

The underlying call being made is quite expensive so it should only be used where absolutely necessary.

Screenshot of reproduction

Screenshot from 2020-06-09 18-58-34

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions