[wp-hackers] wp_cron - What timezone do they run under?

Otto otto at ottodestruct.com
Thu Mar 10 16:56:35 UTC 2011


Cron events are generally scheduled for some period of time in the
future or on a recurring schedule. The only constant ticking time
value that never really changes is the output of time() or gmtime().
Screwing around with timezones the way WP makes the time value
confusing.

If you need to get a time() -like value for a specific local time, use
this code:

mysql2date('U', some-localtime-string, false)

That will give you back a value converted using strtotime() that will
be in the same timezone as whatever time() is.

-Otto



On Thu, Mar 10, 2011 at 10:45 AM, Scott Kingsley Clark <scott at skcdev.com> wrote:
> Oh wow, was there a reason it doesn't use the WP timezone since everywhere
> else it is?


More information about the wp-hackers mailing list