Managing the Time Zone Variable


Contents

About this document
    Related documentation
About DST
Turning DST on
Turning DST off
Changing the effective date to switch to DST
How switching to DST affects cron jobs

About this document

This document discusses the Time Zone (TZ) variable and how to change to and from Daylight Savings Time (DST). This document applies to both AIX 3.2 and AIX Version 4.

Related documentation

The product documentation library is also available:
http://www.rs6000.ibm.com/resource/aix_resource/Pubs/index.html


About DST

If the Daylight Savings Time option is enabled, the default in AIX is for the system time to move forward 1 hour (to DST) at 2:00am the first Sunday in April, and move back one hour (to Standard Time) at 2:00 a.m. on the last Sunday in October. The default is hard coded and is not stored in any user accessible file. However, the date and time at which the switch to DST and ST occurs can be altered by the root user. To see if DST is enabled, echo $TZ; if the time zone variable ends in DT, DST is enabled.


Turning DST on

To enable Daylight Savings Time, you can do so with SMIT. Enter:

    smit chtz 
     Answer "1 yes" to "Use Daylight Savings Time?" 

Turning DST off

If Daylight Savings Time does not apply to your location, you can turn this option off with the following sequence of SMIT menus:

    smit chtz 
     Answer "2 no" to "Use Daylight Savings Time?" 

Changing the effective date to switch to DST

To change the date or time at which the system switches to DST and back to ST, edit the TZ line in /etc/environment. Change the line to read like the following:

   TZ=CST6CDT,M4.1.0/1:00:00,M10.1.0/1:00:00 

This would effect a change to Daylight Savings Time at 1:00 AM on the first Sunday in April and change back at 1:00 AM on the first Sunday in October, and keep the US Central Time Zone time offset from GMT. The breakdown of the string is:

In more detail the format is TZ = local_timezone,date/time,date/time. Here date is in the form of Mm.n.d, day d(0-6) of week n (1-5, where week 5 means "the last d day in month m" and which may occur in either the fourth or the fifth week) of month m of the year. Week 1 is the first week in which the day d occurs. Day zero is Sunday. This format is compliant with POSIX 1003.1 standards for Extensions to Time Functions.

NOTE: If you are running AIX version 4.1 and the fileset bos.sysmgt.smit is at 4.1.5.6 or greater, this can be changed in the chtz smit panel.

If you are running AIX version 4.2 and the fileset bos.sysmgt.smit is at 4.2.1.4 or greater you can change this in the chtz smit panel.

AIX version 4.3 supports changing this in the chtz smit panel by default.


How switching to DST affects cron jobs

If you have a cron job that is to be run at 2:01am and it is the time of year when the time springs forward, this job will not run. The time skips from 2:00am to 3:00am. On the other hand, when the time is being set back one hour, jobs that run between 1:00am and 2:00am will run twice.

So, for jobs set between 2:00am and 3:00am, in the spring it is necessary to either change the time for these jobs to run, run them manually, or wait until the following day to run them. The cron daemon does not need to be stopped; however, if changes are made to the TZ variable, then kill the current cron daemon so that it will automatically respawn and recognize the new TZ setting.

NOTE: Daylight savings time is just a way in which time is displayed to the user. Time is still kept the same internally, so programs such as dce which use time as it is stored internally will not be affected by daylight savings time.


[ Doc Ref: 90605225214680     Publish Date: Oct. 02, 2000     4FAX Ref: 1296 ]