If you're managing an AIX environment that's in a Daylight Saving time zone, there are a few little gotchas to be aware of.

AIX 6.1 introduced the Olson time zone format. This format is now the default for AIX 6.1 and 7.1, but you can still use the original POSIX format if you really want to. What's the difference between the two? The Olson format keeps the time settings hidden, so you can set your time zone to something like:

Europe/Paris

Or

Australia/Sydney

However, you might have a few questions about this new format: Does AIX know whether the time zone observes Daylight Saving Time? If AIX does know, how can it tell when Daylight Saving Time starts and ends? The answer to these questions is simple: AIX uses a database.

The POSIX format, on the other hand, is more transparent to the system administrator, although it does take some effort to master the syntax.

Olson or POSIX?

How do you know whether you're using Olson or POSIX in your AIX environment? The answer is the TZ (Time Zone) environmental variable.

You can check the TZ variable in /etc/environment. A simple grep command will do the trick:

grep TZ /etc/environment

If the variable appears as something like:

America/Sao_Paolo

You're using the Olson time format.

On the other hand, if it comes back with a string like this:

TZ=CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00

Then it's the POSIX format.

The POSIX format isn't that daunting once you break it down. Let me borrow the explanation of the TZ variable above from an excellent article about time zones on IBM developerWorks:

Once again, here's the big TZ string:

TZ=CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00

This string would effect a change to Daylight Saving Time (DST) at 2:00 AM on the second Sunday in March, and then change back at 2:00 AM on the first Sunday in November, keeping 6 hours' time offset from Greenwich Mean Time (GMT) every year. Here's the breakdown of the string:

  • 'CST6CDT': the name of the time zone
  • 'CST': the abbreviation used when DST is off
  • '6': the time difference in hours from GMT
  • 'CDT': the abbreviation used when DST is on
  • ',M3': the third month of the year
  • '.2': the second occurrence of the day in the month
  • '.0': the day of the week, Sunday
  • '/2:00:00': the time of the change
  • ',M11': the eleventh month of the year
  • '.1': the first occurrence of the day in the month
  • '.0': the day of the week, Sunday
  • '/2:00:00': is the time of the change

Now, if you're using the POSIX TZ format, you should be able to apply the same breakdown to your own time zone.

What's the time, Olson?

But what about the Olson format? It's simpler to use, but less transparent, as it keeps its Daylight Saving dates hidden. Even so, you can inspect the content of the Olson time zone database using the zdump command.

Here's how to find out when the Daylight Saving changes are set for Sydney, Australia:

First, you can confirm the time zone using the grep command you saw before:

grep TZ /etc/environment
TZ=Australia/Sydney

Armed with this information, it's easy to extract the start and end of each Daylight Saving for 2014:

zdump -v Australia/Sydney | grep 2014
Australia/Sydney  Sat Apr  5 15:59:59 2014 UTC = Sun Apr  6 02:59:59 2014 EST isdst=1
Australia/Sydney  Sat Apr  5 16:00:00 2014 UTC = Sun Apr  6 02:00:00 2014 EST isdst=0
Australia/Sydney Sat Oct  4 15:59:59 2014 UTC = Sun Oct  5 01:59:59 2014 EST isdst=0
Australia/Sydney Sat Oct  4 16:00:00 2014 UTC = Sun Oct  5 03:00:00 2014 EST isdst=1

The 'UTC' in these strings stands for Coordinated Universal Time (the acronym comes from the French, which is why it's not CUT). 'EST' abbreviates Eastern Standard Time for Australia. At the end of each line you see 'isdst'. This is the variable that indicates when it's time for the clocks to spring forward or fall back. Remember, October in Australia is the middle of spring, which is why the clocks are brought forward in preparation for the summer.

Manage your Time

If you get a handle on which time format you're using for Daylight Saving, it can make life that much easier when the time comes to be awake an hour earlier, or to get an extra hour's sleep (that's always the one night you're up extra late, isn't it?).

Incidentally, if you're ever looking for an animated discussion with some strangers, talking about Daylight Saving is an excellent ice breaker. It's a topic about which pretty much everyone seems to have an opinion.

For an amusing look at the huge differences between Daylight Saving time zones, watch CGP Grey explain how Daylight Saving Time works in this video.