DA-660-8/16-LX User’s Manual
Managing Embedded Linux
3-10
Timezone Setting
Two methods are available for configuring the timezone setting.
1.
Using the TZ variable
TZ=standardHH[:MM[:SS]][daylight[HH[:MM[:SS]]][,startdate[/starttime],
enddate[/endtime]]]
The time kept by the local machine should be a universal standard representation, such as
Greenwich Mean Time (GMT) or Universal Time Coordinated (UTC), which we refer to
collectively as the “universal reference time.” For personal computers that do not share data
across time zones, the local time is an adequate standard. To support a universal standard, all
MKS utilities assume that times stored in the file system and returned by the operating system
are stored in the universal reference time, and then translated to local times. The mapping
from the universal reference time to local time is specified by the TZ (time zone) environment
variable. If left undefined, the TZ variable defaults to the current time zone setting of your
operating system.
Here are some possible settings for the North American Eastern time zone:
TZ=EST5EDT
TZ=EST0EDT
TZ=EST0
In the first case, the reference time is GMT and the stored time values are correct worldwide.
A simple change of the TZ variable prints local time correctly anywhere. In the second case,
the reference time is Eastern Standard Time and the only conversion performed is for Daylight
Savings Time. For this reason, there is no need to adjust the hardware clock for Daylight
Savings Time twice a year. In the third case, the reference time is always the time reported.
This is suggested if the hardware clock on your machine automatically adjusts for Daylight
Savings Time or you insist on manually resetting the hardware time twice a year.
Other examples include:
TZ=NST3:30NDT2:00
TZ=MSEZ-1
The first applies to Newfoundland, whereas the second works in most of Western Europe.
Here are some time zone scenarios that involve Daylight Savings Time specifications:
TZ=PST0PDT-1
TZ=ACST-09:30ACDT-10:30,M10.5.0/2:00,M3.5.0/2:00
The first scenario shows the TZ of a person in Seattle who stores local time on a PC, but does
not adjust the clock to agree with Daylight Savings Time. The stated time zone precedes the
machine clock time by one hour when Daylight Savings Time is in effect.
The second scenario shows the TZ set by a person in Australia who sets a PC clock to UTC
and never adjusts it. The machine clock precedes UTC by 9.5 hours when Daylight Savings
Time is not in effect, and by 10.5 hours when it is in effect. Daylight Savings Time is in effect
from 2:00 am on the last Sunday in October until 2:00 am on the last Sunday in March.
To cause the timezone setting to be activated after the DA-660 reboots, add the line
export TZ=your_timezone_setting
to the file
/etc/rc.d/rc.local
.