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

We’ve got the exact same issue happening; our server is CDT (GMT -5 hours) and it’s also set to Central time in Magento, but there’s several times when date() calls are performed when it returns the time in UTC (GMT+0 hours, effectively), thereby causing some dates and times to be off by 5 hours. What we did to fix it is:

1) Ensured the clock on our webserver was set to the correct time and time zone:
2) Ensured that PHP is set to the correct time zone:
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:

Europe/Rome'; // Use your time zone as found in

5) Change the default timezon in file 'app/Mage.php'



Chances are high that your web server is already set up correctly, and if you’re not running a dedicated server your host will be the one to determine steps 1 & 2. Steps 3-4 are the important ones for you to do. Note that because you’re editing a core file, your changes will have to be re-applied each time you upgrade (as necessary).

N.B.: for timezone costants see :

Site Search

Who's Online

Abbiamo 9 visitatori e nessun utente online



Visite agli articoli
banner mym
banner mym