You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jkellyinsf opened this issue
Jan 23, 2020
· 4 comments
Labels
i18n-apiIssues and PRs related to the i18n implementation.v8 engineIssues and PRs related to the V8 dependency.windowsIssues and PRs related to the Windows platform.wontfixIssues that will not be fixed.
I wrote this modest test file date.js that shows how the TZ env var is set and what time zone dates are using.
console.log(`node platform ${process.platform}, version ${process.version}`)console.log(`process.env.TZ = ${process.env.TZ}`)console.log(`default date ${newDate().toString()}, offset = ${newDate().getTimezoneOffset()}`)
My machine is in Pacific Time. When I override the TZ to UTC and run this script through the linux build of node (on Ubuntu under WSL), I get the UTC dates I expect:
$ TZ=UTC node date.js
node platform linux, version v13.7.0
process.env.TZ = UTC
default date Thu Jan 23 2020 14:54:15 GMT+0000 (Coordinated Universal Time), offset = 0
When I run it with the Windows build, process.env.TZ claims to be in UTC, but dates still come out in Pacific Time.
# set TZ=UTC && node date.js
node platform win32, version v13.7.0
process.env.TZ = UTC
default date Thu Jan 23 2020 06:54:30 GMT-0800 (Pacific Standard Time), offset = 480
The text was updated successfully, but these errors were encountered:
addaleax
added
v8 engine
Issues and PRs related to the V8 dependency.
windows
Issues and PRs related to the Windows platform.
i18n-api
Issues and PRs related to the i18n implementation.
labels
Jan 23, 2020
Unless there was something to actively set that on Windows, we're talking about a UNIX-specific variable so I would agree with @bnoordhuis - there's no reason why it would generally be interpreted by processes on Windows. If it was to be processed on non-UNIX based platforms, there would likely need to be a handler within Node.js itself to interpret all of the values in there to map all of the potential values of TZ to something meaningful - I haven't checked the code but I assume Node is currently calling into the OS to do the time zone translation.
i18n-apiIssues and PRs related to the i18n implementation.v8 engineIssues and PRs related to the V8 dependency.windowsIssues and PRs related to the Windows platform.wontfixIssues that will not be fixed.
I wrote this modest test file date.js that shows how the TZ env var is set and what time zone dates are using.
My machine is in Pacific Time. When I override the TZ to UTC and run this script through the linux build of node (on Ubuntu under WSL), I get the UTC dates I expect:
When I run it with the Windows build, process.env.TZ claims to be in UTC, but dates still come out in Pacific Time.
The text was updated successfully, but these errors were encountered: