I recently transferred servers and ever since my timestamps in Magento (both orders and help desk messages) are incorrect. I have checked all of my configuration settings, and they are correct. I have tried all of these: https://magentocookbook.wordpress.com/2010/02/15/magento-date-time/ which gave me a 404 site wide. I followed this guide to edit .htaccess: https://www.a2hosting.com/kb/developer-corner/php/using-php-directives-in-custom-htaccess-files/setting-the-php-time-zone-in-an-htaccess-file and have built the script and from what I can tell it says our timezone is correct. Any assistance as to what may be causing this sort of issue or how to fix would be appreciated!
2 Answers
All times stored in Magento's database are stored in UTC, Coordinated Universal Time.
Any time date or time is encountered for display then the Timezone specified in your Admin configuration is used to convert the UTC to the Timezone specified.
Further reading:
-
Thank you Boomer, and I have read this, many times. But it does not seem to be helping me. Our issue is that we are -7hrs UTC, however, in our Magento Backend we seem to be an additional 7hrs off of that...almost as if our databases are storing the times in MST not UTC and then converting from from there (if that makes sense...)– LindsayNov 18, 2015 at 16:25
-
I have seen some people actually change the timezone within the zend library which can result in lots of oddities for time/dates. Take a look at github.com/OpenMage/magento-mirror/blob/magento-1.9/lib/Zend/… and also check index.php for any timezone sets. Adding the timezone in
.htaccess
should be avoided as thephp.ini
should be set to the time zone relative to the hosting providers locale already.– B00MERNov 18, 2015 at 23:43
If you do this, what it's displays you ?
$date= Mage::getModel('core/date')->timestamp(time());
$now= date('Y-m-d h:i:s', $date);
Zend_Debug::dump($now);
-
string(19) "2017-07-27 09:33:59"
and that's one hour behind what' set in Magento system=>config=>local– HaimJul 27, 2017 at 14:34
date
?