New Zealand daylight savings starts on SundayNew Zealand daylight savings starts on Sunday

Posted September 26th, 2008 in Linux/Unix/BSD and PHP

The dates that New Zealand daylight savings starts and ends changed in New Zealand last year and it caused a lot of issues with many servers and desktop computers which hadn't had updates made available in time for the change. Daylight savings starts this Sunday in New Zealand on Sunday September 28th and I thought it a good idea to check the servers I manage are all correct and ready to handle the changeover.

To check the daylight savings setting on a Linux box, read my "Checking daylight savings settings on Linux" post from March this year, which is when New Zealand moved from daylight savings to regular time. The correct output from the zdump command should be as follows, and is the same as in the original post:

/etc/localtime  Sat Apr  5 13:59:59 2008 UTC = Sun Apr  6 02:59:59 2008 NZDT isdst=1 gmtoff=46800
/etc/localtime  Sat Apr  5 14:00:00 2008 UTC = Sun Apr  6 02:00:00 2008 NZST isdst=0 gmtoff=43200
/etc/localtime  Sat Sep 27 13:59:59 2008 UTC = Sun Sep 28 01:59:59 2008 NZST isdst=0 gmtoff=43200
/etc/localtime  Sat Sep 27 14:00:00 2008 UTC = Sun Sep 28 03:00:00 2008 NZDT isdst=1 gmtoff=46800

There was also an issue with PHP during the last daylight savings change. As it turned out, PHP 5 contains its own internal timezone database and it was incorrect. I can only assume it has been updated to reflect the correct timezone now, but I'll be logging in on Sunday morning to my servers to double check the times are being displayed correctly.

In the meantime, I made sure all my servers had the most up to date version of PHP for their distro this morning. I run CentOS on all of these machines, so updated from the command line using YUM. Read my "Update PHP from the command line with YUM" post from a few days ago for details about how to do this on YUM based Linux distros.

If the timezone isn't correct in PHP on Sunday, there are still a couple of things you can do. One is to install the PECL timezonedb module and the other is to manually adjust the date.timezone setting in the php.ini file. Both of these possibilities are covered in my "Correcting the PHP timezone" post from the March changeover.

Good luck, and here's hoping I don't have to mess with any settings on Sunday morning!

Comments

blog comments powered by Disqus