Timezones and cron
I have a MySQL database containing details of shops in different time zones. The timezone of each store is stored in iana format and the MySQL datetimes are stored in UTC.
I wish to execute some php code at the end of the day for each shop.
This is how I am thinking to approach this but is there a better way?
If IANA time zone format means offset to UTC, you could simply look for shops having a timezone like
24 - current time(UTC) +/- DST
Negative timezone offsets work similar, eg 24 + offset
. So timezone offset -01:00
would become +23:00
Nothing to say here.
上一篇: PHP脚本不能在Ubuntu服务器上作为cron作业运行
下一篇: 时区和克朗