summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-05-07 09:16:29 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-05-07 09:17:27 -0700
commit42f33ae68c579893ea0d7b151e6252b77274ccb7 (patch)
tree28cbcdb6baf3baf06626469964c6cd3e9dfa4392
parent7edec89fc324aabef3f27925ccd962b801783324 (diff)
downloadcoreutils-42f33ae68c579893ea0d7b151e6252b77274ccb7.tar.gz
doc: time zone conversion example
* doc/coreutils.texi (Examples of date): Give time zone conversion example.
-rw-r--r--doc/coreutils.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index b7c6bfe42..6a693e283 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -16918,6 +16918,16 @@ date --date='1970-01-01 00:02:00 +0000' +%s
120
@end example
+To convert a date string from one time zone @var{from} to another @var{to},
+specify @samp{TZ="@var{from}"} in the environment and @samp{TZ="@var{to}"}
+in the @option{--date} option. @xref{Specifying time zone rules}.
+For example:
+
+@smallexample
+TZ="Asia/Tokyo" date --date='TZ="America/New_York" 2023-05-07 12:23'
+Mon May @ 8 01:23:00 JST 2023
+@end smallexample
+
If you do not specify time zone information in the date string,
@command{date} uses your computer's idea of the time zone when
interpreting the string. For example, if your computer's time zone is