Skip to content

Scheduled posts are publishing in GMT instead of blog-specific timezone #143

Closed as not planned

Description

@theSCHAPPY

Feature Request

Describe your use case and the problem you are facing

Consider a Wordpress instance using a blog-specific timezone setting (different from a timezone setting in php.ini). If you schedule a post for publishing the blog's specific timezone setting is used for publishing. However, runinng wp cron regularly triggered by a system cronjob, apparently considers publishing times as GMT.

Describe the solution you'd like

Would be great if blog-specific timezone settings could be incorporated for publishing posts. If a manual timezone setting is specified in php.ini, the correct publishing time is derived apparently. The timezone setting in wp-admin/options-general.php read the following from wp_options to derive the blog-specific timezone setting string $tzstring:

  • get_option( 'gmt_offset' )
  • get_option( 'timezone_string' )

Thanks in advance!

Activity

  1. swissspidy commented on Jun 16, 2026

    @swissspidy
    Member

    Thanks for opening the issue.

    WP-CLI's cron-command package does not perform any custom timezone calculations or scheduling logic of its own. It relies entirely on native WordPress core cron features (such as wp_get_ready_cron_jobs()) and standard PHP functions.

    Additionally, when WP-CLI bootstraps WordPress, WordPress Core forces PHP's runtime timezone to UTC (date_default_timezone_set( 'UTC' )).

    If scheduled posts are not publishing at the expected local time, it is typically caused by:

    1. An incorrect site timezone configured in Settings > General inside the WordPress Admin dashboard (which WordPress uses to compute the UTC date when scheduling).
    2. The server's OS clock itself being out of sync (causing time() / microtime( true ) to return incorrect Unix epochs).
    3. A plugin or theme executing custom code that alters the PHP timezone (via date_default_timezone_set()) after WordPress has loaded.

    Because this is handled entirely within WordPress Core's cron functions and option configurations rather than WP-CLI, I'm going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions