Magento Cron Tab作业时区 [英] Magento Cron Tab Job Time zone

查看:147
本文介绍了Magento Cron Tab作业时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的模块的cron设置为凌晨1点(0 1 * * *)。我想知道我的模块cron是否在正确的时间运行。 ,默认商店的时区为西欧(巴黎,柏林等GMT +2),服务器时间为EDT(东部夏令时)。



时区是基于

$ p

的1am时间表。

解决方案> Magento cron进程在UTC时区下运行。



这可以通过临时向cron观察者添加一个小日志语句来验证。



方法是:

  Mage_Cron_Model_Observer :: dispatch()

在前几行中查找此代码:

  $ now = time(); 

在之前或之后,添加:

  Mage :: log(cron timezone:。date_default_timezone_get(),Zend_Log :: DEBUG); 

然后检查您的var / log / system.log文件,你会看到PHP / Magento正在使用UTC时区。


Im trying to figure out if my module cron is running at the correct time.

The cron for my module is set at 1am (0 1 * * *), the time zone of the default store is Western Europe (Paris, Berlin etc GMT +2), the server time is EDT (Eastern Daylight Time).

So on which time zone is the 1am schedule based on?

Thanks,

解决方案

The Magento cron process runs under the UTC timezone.

This can be verified by temporarily adding a small log statement to the cron observer.

The method is:

Mage_Cron_Model_Observer::dispatch()

Look for this code in the first few lines:

$now = time();

Either right before or after, add this:

Mage::log("cron timezone: " . date_default_timezone_get(), Zend_Log::DEBUG);

Then check your var/log/system.log file and you will see that PHP/Magento is using the UTC timezone.

这篇关于Magento Cron Tab作业时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆