[wp-trac] [WordPress Trac] #17957: wp_reschedule_event & daylight saving
WordPress Trac
noreply at wordpress.org
Sun Jan 27 09:32:40 UTC 2013
#17957: wp_reschedule_event & daylight saving
-------------------------+------------------------------
Reporter: MattyRob | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Cron | Version: 3.2
Severity: normal | Resolution:
Keywords: needs-codex |
-------------------------+------------------------------
Comment (by MattyRob):
Over the last few months I've tried different appraches to this, I find
that these both work:
{{{
$time = current_time('timestamp') + $interval;
while ($timestamp < current_time('timestamp')) {
// if we are trying to set the time in the past increment it
forward
// by the interval period until it is in the future
$timestamp += $interval;
}
}}}
And:
{{{
$time = time() + $interval;
while ($timestamp < time()) {
// if we are trying to set the time in the past increment it
forward
// by the interval period until it is in the future
$timestamp += $interval;
}
}}}
However, I'd have to say that using current_time() seems to me more
reliably offset to GMT on local servers and needs less manipulation than
the results from time().
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17957#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list