Ashley solution should work, but first you have to wrap it strtotime()
echo date("Y-m-d", strtotime($_product->getUpdatedAt()));
I would recommend using the Magento date model to get the time in your time zone (it will also take care of your timestamp).
echo Mage::getModel('core/date')->date("Y-m-d", $_product->getUpdatedAt());
Take a look at app/code/core/Mage/Core/Model/Date.php
<?php
class Mage_Core_Model_Date
{
public function date($format = null, $input = null)
{
if (is_null($format)) {
$format = 'Y-m-d H:i:s';
}
$result = date($format, $this->timestamp($input));
return $result;
}
public function timestamp($input = null)
{
if (is_null($input)) {
$result = $this->gmtTimestamp();
} else if (is_numeric($input)) {
$result = $input;
} else {
$result = strtotime($input);
}
$date = Mage::app()->getLocale()->date($result);
$timestamp = $date->get(Zend_Date::TIMESTAMP) + $date->get(Zend_Date::TIMEZONE_SECS);
unset($date);
return $timestamp;
}
}
source
share