When I created an order,the order confirmation email showed me the wrong time.
What's wrong?
Even though i changed the default timezone on Mage.php, locale.php and config.xml, the order confirmation email showed me the EDT+1 date. It's very wired. Is there any solution?
I already matched the server time, web server time and store timezone.
The time created in the email template {{var order.getCreatedAtFormated('long')}}
shows us the "UTC+1".
Hope good solution.
Comments: I debugged it on local server and live site. When I get the time result on these codes, live site shows me the wrong time.
All sources are same because local source is a clone from live site Live site uses the external database(RDS), but local server is not.
\app\code\core\Mage\Sales\Model\Abstract.php
/**
* Get object created at date affected with object store timezone
*
* @return Zend_Date
*/
public function getCreatedAtStoreDate()
{
return Mage::app()->getLocale()->storeDate(
$this->getStore(),
Varien_Date::toTimestamp($this->getCreatedAt()),
true
);
}
Solved this issue. In the some modules, there were timezone reset code part. It was settled as "EST". After fixing it with UTC, the time of order email was corrected.
//date_default_timezone_set('EST');
date_default_timezone_set(Mage_Core_Model_Locale::DEFAULT_TIMEZONE);
Solved successfully.