Support » Plugin: Missed Schedule Fix WP Failed Future Posts » Publishing Ahead of Schedule (TimeZone Issues)

  • Resolved milewis1


    On my blog, the WordPress timezone is different than the timezone set on the MySQL server. In this case this plugin ends up publishing future items early.

    I would recommend a change to the query:

    global $wpdb;
    	$sql = $wpdb->prepare(
    		"SELECT<code>ID</code>FROM<code>{$wpdb->posts}</code>"."WHERE("."((<code>post_date</code>>0)&&(<code>post_date</code><=%s))OR"."((<code>post_date_gmt</code>>0)&&(<code>post_date_gmt</code><=%s))".")AND<code>post_status</code>='future'LIMIT 0,5",
    		current_time('mysql'),		// Blog local time
    		current_time('mysql', 1)	// UTC Time

    This will use the WordPress blog’s timezone instead of the MySQL server, which should give better results.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Publishing Ahead of Schedule (TimeZone Issues)’ is closed to new replies.