Eliminating time shift with birthdates while syncing iPhone and Horde


Published on December 30, 2013 by Marcus Rickert

Horde Php Bugfix

1 min READ

Ever since I used my iPhone with Horde I’ve had trouble with syncing birthdates: due to timezone conversions the dates on the server usually were shifted to earlier times. If the same entry got synced several times the shifts would accumulate usually moving the birthdates several days.

Originally, I fixed this by directly modifying one of the PHP files. However, just yesterday I made an upgrade to the latest stable GIT version of Horde (5.1.5) only to find out that the problem still prevails: Horde ticket 12581.

Following the suggestion in the ticket I explicitly set the date.timezone setting in the ‘php.ini’ file of my Apache2 server located in /etc/php5/apache2/php.ini:

date.timezone = "Europe/Berlin"    

This setting is normally commented out. Apparently, it has to be the same as the server setting. After this change the birthdays were “stable”. :-)

By the way: I had gotten the following run-time error when running another PHP application at a much earlier time but kind of forgot to react to it:

Warning: date(): It is not safe to rely on the system's timezone settings. 
You are *required* to use the date.timezone setting or the 
date_default_timezone_set() function. In case you used any of those methods 
and you are still getting this warning, you most likely misspelled the timezone 
identifier. We selected the timezone 'UTC' for now, but please set 
date.timezone to select your timezone.