[tz] CST timezone that does not account for DST
eggert at cs.ucla.edu
Wed Jul 29 23:04:05 UTC 2015
Nilesh Parmar wrote:
> Using the POSIX string, we can create a timezone called CST that is GMT+6 as follows:
> [root at hp-dl120gen9-01 ~]# TZ=:CST6 date
> Thu Jul 9 06:50:29 CST 2015
TZ=':CST6' uses an implementation-specific extension to POSIX. Often in this
case implementations ignore the ':' so it's equivalent to TZ='CST6'. tzcode
does that, and I assume glibc does too.
With TZ='CST6', the time zone is six hours behind UTC (i.e., west of Greenwich),
$ date -u; TZ=CST6 date
Wed Jul 29 22:52:44 UTC 2015
Wed Jul 29 16:52:44 CST 2015
> But this is not consitent if tzdata package is update.
A TZ setting like 'CST6' is a string specified by POSIX, and should work
correctly regardless of what's in tzdata.
> Also this does take into account DST change?
TZ='CST6' has no DST.
For more about POSIX TZ settings, please see:
More information about the tz