>If you know the time zone of the place of interest:
> For timezone 5 (Eastern Standard Time)
>Gives Tue Feb 22 15:52:02 PST 1994
> For timezone 8 (Pacific Standard Time)
>Gives Tue Feb 22 15:52:06 PST 1994
>Note: The parens are important ()
1) TZ=8 is a Bourne-shell-ish syntax; if you have a Bourne-compatible
shell, you could do
with no parentheses.
This is a general trick; you can run a command with various
environment variables temporarily set to other values, e.g.
to run "command" with TERM set to some value other than its current
If you do *not* have a Bourne-compatible shell, you may have to do
something such as
(setenv TZ 8; date)
(except that you wouldn't use "8", you'd use something else; see the
next three items, which explain why "8" isn't the right setting).
2) The correct very-old-style time zone syntax is *not* just the offset
from UTC in hours, it's more like "PST8PDT" for Pacific time, so
you'd have to do
to get Pacific time and
to get Eastern time.
3) The above means that the rules for when daylight savings time/summer
time starts and ends may be the "default" rules on your system, and
may not be correct for some other time zone. There is a somewhat
rococo syntax adopted in System V Release 3.1 or so, and an even
*more* rococo syntax adopted by POSIX, for putting the rules into the
4) If you have a system with a *good* time zone implementation, you
probably have with with the Arthur Olson code, which puts the rules
in files, where they belong, rather than in TZ itself. For example,
in systems that have the Olson code and the right time zone files,
will do (assuming that the Hong Kong rules on your system are correct).