If you are using default time functions like now(),date(),time() in Magento you'll be shocked by the result of it

Even if you have correct timezone in your php.ini the result will be surprise.


//Show date and get wrong datetime
$now = time();
echo date('m/d/y h:i:s', time());

This is so because whatever settings are in your php.ini - Magento set current timezone to UTC in Mage_Core_Model_App


File:- app/code/core/Mage/Core/Model/App.php Line:-365
/**
 * Initialize PHP environment
 *
 * @return Mage_Core_Model_App
 */
protected function _initEnvironment() {
	$this->setErrorHandler(self::DEFAULT_ERROR_HANDLER);
	date_default_timezone_set(Mage_Core_Model_Locale::DEFAULT_TIMEZONE);
	return $this;
}

The solution is easy - check your timezone in Configuration Settings and use this code to get correct time


$now = Mage::getModel('core/date')->timestamp(time());
echo date('m/d/y h:i:s', $now);

Hope this advice will help you to quickly find solution