WordPress.org

Ready to get started?Download WordPress

Forums

Timezones and wp_cron (2 posts)

  1. Steve
    Member
    Posted 3 years ago #

    I've got a slight problem:

    date_i18n($time_format) returns the time with the users current timezone offset applied and formatted to their format.

    date_i18n(get_option('time_format'),wp_next_scheduled('my_cron_job')

    returns the next execute time of the specified cron job with the users current timezone offset applied and formatted appropriately.

    UNLESS they are running on FASTCGI when it seems to return the next execute time in GMT/UTC.

    So I think what is happening is that when you set the cron_job up its setting it up with the wrong timestamp when you are using FastCGI.

    Can someone else confirm this as I don't use FastCGI on my server.

  2. Steve
    Member
    Posted 3 years ago #

    Actually I think it was me

    There is a difference between time() and current_time( 'timestamp' ) on some systems.

Topic Closed

This topic has been closed to new replies.

About this Topic