As this took a while to discover, I figured I would document this for anyone else with this issue, and for my own future reference.
- system time was correct and in the correct time zone.
- Using the “speaking clock” feature (*60 on this system), the time was correct.
- The “Server Time” displayed on the “Time Conditions” page was incorrect and off by exactly 2 hours.
Since the time was exactly 2 hours off it is clearly a time zone issue, however the issue has nothing to do with Asterisk. PHP has a separate time zone setting in “/etc/php.ini”.
Edit the php.ini file and modify the “date.timezone” parameter to match the system time zone as found in “/usr/share/zoneinfo/”
$ grep timezone /etc/php.ini date.timezone = America/Chicago
If you are having any other time zone related issues, here are the standard settings for most Linux operating systems: (Examples all use US Central time zone)
Create a symlink from the time zone file to “/etc/localtime”. you may need to delete the file if it already exists.
$ ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
Add a time zone environment variable.
$ echo "export TZ=America/Chicago" >> /etc/profile
- On some Red Hat and similar systems, the time zone is also stored in “/etc/sysconfig/clock”. Edit this file and set the correct time zone.
$ cat /etc/sysconfig/clock ZONE="America/Chicago" UTC=true[/color] ARC=false
Note that a reboot is required to completely enable the changes made to system time zone settings.