From 42f33ae68c579893ea0d7b151e6252b77274ccb7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 7 May 2023 09:16:29 -0700 Subject: doc: time zone conversion example * doc/coreutils.texi (Examples of date): Give time zone conversion example. --- doc/coreutils.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- cgit v1.2.1