Magento – What timezone are Magento cron jobs being run in

configurationcrontimezone

My system's timezone is US/Eastern, my default store is US/Central and the database is UTC. At what time will the following doStuff method be called?

<mymodule_do_stuff>
    <schedule><cron_expr>15 0 * * *</cron_expr></schedule>
    <run>
        <model>mymodule/observer::doStuff</model>
    </run>
</mymodule_do_stuff>

Update: I ran this script .

echo date('r'), PHP_EOL;
require_once 'app/Mage.php';
Mage::app();

echo date('r'), PHP_EOL;

and got

Mon, 30 Dec 2013 18:01:33 -0600
Tue, 31 Dec 2013 00:01:34 +0000

So it looks like UTC is what I should be using.

Best Answer

The default time used will be the system time of linux. Use the date function on the command line to find out what it is set to.

Magento 'overwrites' that by setting the locale to whatever you have specified during the installation of the shop. This is specified in the System > Configuration > General per store or on default scope.

Related Topic