Magento: Datetime of server and datetime of Magento don't match

1) Ensured the clock on our webserver was set to the correct time and time zone: http://www.wikihow.com/Change-the-Timezone-in-Linux
2) Ensured that PHP is set to the correct time zone: http://www.electrictoolbox.com/correct-php-timezone/
3) Ensured that Magento was also set to the correct time zone (System -> Configuration -> General)
4) Changed the default time zone in Magento from UTC to our timezone: edit app/code/core/Mage/Core/Model/Locale.php
Find line 30 and change to:
//const DEFAULT_TIMEZONE = 'UTC';
const DEFAULT_TIMEZONE = '
Europe/Rome'; // Use your time zone as found in http://www.php.net/manual/en/timezones.php
5) Change the default timezon in file 'app/Mage.php'
//date_default_timezone_set('UTC');

date_default_timezone_set('Europe/Rome');

Comments