Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2021-05-11 19:10:46 +0300
committerJames M Snell <jasnell@gmail.com>2021-05-17 22:02:49 +0300
commit16cb4f720b43345c9ed34f4a67165e86fbba5b90 (patch)
tree04fdde70aa88178e21ecc71b4d60b0ed932c0255 /doc/api/cli.md
parent75340f3c524cbe8602ba8f5a48b8bf8572bad8f1 (diff)
lib: support setting process.env.TZ on windows
Fixes: https://github.com/nodejs/node/issues/4230 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/38642 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'doc/api/cli.md')
-rw-r--r--doc/api/cli.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md
index c2e5f907957..a47d724bf90 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -1669,6 +1669,37 @@ Be aware that unless the child environment is explicitly set, this environment
variable will be inherited by any child processes, and if they use OpenSSL, it
may cause them to trust the same CAs as node.
+### `TZ`
+<!-- YAML
+added: v0.0.1
+changes:
+ - version:
+ - REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/38642
+ description:
+ Changing the TZ variable using process.env.TZ = changes the timezone
+ on Windows as well.
+ - version:
+ - v13.0.0
+ pr-url: https://github.com/nodejs/node/pull/20026
+ description:
+ Changing the TZ variable using process.env.TZ = changes the timezone
+ on POSIX systems.
+-->
+
+The `TZ` environment variable is used to specify the timezone configuration.
+
+While the Node.js support for `TZ` will not handle all of the various
+[ways that `TZ` is handled in other environments][], it will support basic
+[timezone IDs][] (such as `'Etc/UTC'`, `'Europe/Paris'` or `'America/New_York'`.
+It may support a few other abbreviations or aliases, but these are strongly
+discouraged and not guaranteed.
+
+```console
+$ TZ=Europe/Dublin node -pe "new Date().toString()"
+Wed May 12 2021 20:30:48 GMT+0100 (Irish Standard Time)
+```
+
### `UV_THREADPOOL_SIZE=size`
Set the number of threads used in libuv's threadpool to `size` threads.
@@ -1743,3 +1774,5 @@ $ node --max-old-space-size=1536 index.js
[jitless]: https://v8.dev/blog/jitless
[libuv threadpool documentation]: https://docs.libuv.org/en/latest/threadpool.html
[remote code execution]: https://www.owasp.org/index.php/Code_Injection
+[timezone IDs]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
+[ways that `TZ` is handled in other environments]: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html