Magento 1.9 – Database Dates Stored in Local Timezone

databasedatetimemagento-1.9timetimezone

I'm having trouble with a timezone issue and I'm looking for confirmation.

Do dates get stored in the database in UTC. This seems to be th consensus I have found in other posts.

For example: If an order is made on our website at 14:00:00 (UTC +13)
it will that be stored in the database -> created_at as 01:00:00?

I ask this as all my dates in the database (viewed through phpmyadmin) seem to be stored in our local time (UTC +13). Is this correct?

Best Answer

Try this one to check the actual date and time as it is configured in your Magento

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