- 论坛徽章:
- 33
|
回复 #11 wazhl 的帖子
参考:
http://archives.devshed.com/foru ... -y-m-d-1795682.html
as long as you use the format TZ=<string><offset>
<stringwill just be some descriptive text that you chose to
describe that rule. As long as you specify an offset (it could
be even more complicated like having two offsets for day light
saving time, and rules to tell when to switch to DST), then the
<stringis not used to define the rules (aaa will not refer to
any description file in /usr/share/zoneinfo contrary to another
contributor said), it will just be used in date +%Z.
So, TZ=aaa24 is a tab zone called "aaa" that is defined as being
offset by 24 wrt Universal time (GMT, UTC).
If you had specified:
TZ=aaa
so, without any rule embeded in $TZ, then "aaa" would have
refered to a system wide timezone, whose rules are defined in a
system wide description file (on some systems in
/usr/share/zoneinfo).
$ TZ=aaa truss -t open date
open("/var/ld/ld.config", RDNLY) Err#2 ENENT
open("/usr/lib/libc.so.1", RDNLY) = 3
open("/usr/lib/libdl.so.1", RDNLY) = 3
open("/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1", RDNLY) = 3
open("/usr/share/lib/zoneinfo/aaa", RDNLY) Err#2 ENENT
open("/usr/share/lib/zoneinfo/aaa", RDNLY) Err#2 ENENT
open("/usr/share/lib/zoneinfo/aaa", RDNLY) Err#2 ENENT
My system doesn't have such system-wide timezone.
$ TZ=Brazil/Acre truss -t open date
open("/var/ld/ld.config", RDNLY) Err#2 ENENT
open("/usr/lib/libc.so.1", RDNLY) = 3
open("/usr/lib/libdl.so.1", RDNLY) = 3
open("/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1", RDNLY) = 3
open("/", RDNLY) = 3
Wed Feb 15 09:24:47 AST 2006
It does have one called Brazil/Acre, but if I decide to specify
the rules for Brazil/Acre to say that it's 24 hours behind UTC:
$ TZ=Brazil/Acre24 truss -t open date
open("/var/ld/ld.config", RDNLY) Err#2 ENENT
open("/usr/lib/libc.so.1", RDNLY) = 3
open("/usr/lib/libdl.so.1", RDNLY) = 3
open("/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1", RDNLY) = 3
Tue Feb 14 14:25:41 Brazil/Acre 2006
the system-wide description file is not used. |
|