Title: Problem with timezone
Last modified: August 22, 2016

---

# Problem with timezone

 *  Resolved [magicca](https://wordpress.org/support/users/magicca/)
 * (@magicca)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/)
 * Hi, first of all, thank you very much for this very helpful plugin!
    I do have
   a problem though. As you may notice, we should setup the same time zone for local(
   computer) and server, otherwise, we will get some missed schedule posts. When
   I setup the timezone of my Computer/Server/WordPress the same as my local time(
   which is UTC-8,Los Angeles, US), Auto Post Scheduler will display a kind of weird
   time(8 hour behind my timezone, = UTC-16, actually no such timezone) and won’t
   work on schedule time, of course. Everything is fine when I setup all timezones(
   Computer/Server/WordPress) to UTC, but I prefer to use my local time instead 
   of UTC time, if it’s possible. Please advise. Thanks.
 * [https://wordpress.org/plugins/auto-post-scheduler/](https://wordpress.org/plugins/auto-post-scheduler/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [johnh10](https://wordpress.org/support/users/johnh10/)
 * (@johnh10)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601548)
 * Hello,
    APS uses the [current local time](http://codex.wordpress.org/Function_Reference/current_time)
   of the server and the Timezone set in WordPress->Settings->General.
 * When you enable APS what does it display at the top? It should be something like
 * Current Status: Enabled
 * Current server time:2014-12-22 09:29:28 America/New_York
    Next auto post check:
   2014-12-22 10:28:50 America/New_York
 *  Thread Starter [magicca](https://wordpress.org/support/users/magicca/)
 * (@magicca)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601605)
 * Hi, Thanks for your reply.
    There are 3 places setup timezone: 1)server, 2)wp_settings.
   php, 3)WordPress->Settings->General. When I change number 2 (via my theme function,
   of course. It’s not a good idea to touch the WP core, right?) to my timezone 
   by `date_default_timezone_set( 'America/Los_Angeles' );` Auto Post Scheduler 
   will display the weird time, 8 hour behind my timezone. I tested this all the
   day to make sure. see table below(yes=correct, no=wrong):
 *     ```
       Server:      LA    LA     UTC    UTC
       WP_settings: LA    UTC    LA     UTC
       WP option:   LA    LA     LA     LA
       APS:         NO    YES    NO     YES
       ```
   
 *  Plugin Author [johnh10](https://wordpress.org/support/users/johnh10/)
 * (@johnh10)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601621)
 * Why would you need to change wp_settings.php? Sounds like it is converting the
   timezone offset twice. Try it without.
 * APS gets the local time via the WordPress function
    [current_time(“timestamp”)](http://codex.wordpress.org/Function_Reference/current_time)
 *  Plugin Author [johnh10](https://wordpress.org/support/users/johnh10/)
 * (@johnh10)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601624)
 * Yes it looks like double dipping when you call date_default_timezone_set() in
   your code.
 * Added this to functions.php to test
 *     ```
       function heartbeat_debug() {
               error_log('Local Time: ' . date('Y-m-d H:i:s',current_time("timestamp")) . " " . get_option('timezone_string'));
               error_log('GMT Time: ' . date('Y-m-d H:i:s',current_time("timestamp", 1)) . " GMT" );
   
               date_default_timezone_set( 'America/New_York' );
               error_log('calling date_default_timezone_set');
               error_log('Local Time: ' . date('Y-m-d H:i:s',current_time("timestamp")) . " " . get_option('timezone_string'));
               error_log('GMT Time: ' . date('Y-m-d H:i:s',current_time("timestamp", 1)) . " GMT" );
       }
   
       add_action('wp_head', 'heartbeat_debug');
       ```
   
 * Outputs:
    [23-Dec-2014 15:16:50 UTC] Local Time: 2014-12-23 10:16:50 America/
   New_York [23-Dec-2014 15:16:50 UTC] GMT Time: 2014-12-23 15:16:50 GMT [23-Dec-
   2014 10:16:50 America/New_York] calling date_default_timezone_set [23-Dec-2014
   10:16:50 America/New_York] Local Time: 2014-12-23 05:16:50 America/New_York [
   23-Dec-2014 10:16:50 America/New_York] GMT Time: 2014-12-23 10:16:50 GMT
 *  Thread Starter [magicca](https://wordpress.org/support/users/magicca/)
 * (@magicca)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601628)
 * >Why would you need to change wp_settings.php?
    Same timezone as my local computer.
 * >Sounds like it is converting the timezone offset twice.
    Exactly.
 *  Plugin Author [johnh10](https://wordpress.org/support/users/johnh10/)
 * (@johnh10)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601630)
 * That’s what WordPress->Settings->General->Timezone is for.
 *  Thread Starter [magicca](https://wordpress.org/support/users/magicca/)
 * (@magicca)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601632)
 * Never mind.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Problem with timezone’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/auto-post-scheduler_bfcacf.svg)
 * [Auto Post Scheduler](https://wordpress.org/plugins/auto-post-scheduler/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auto-post-scheduler/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auto-post-scheduler/)
 * [Active Topics](https://wordpress.org/support/plugin/auto-post-scheduler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auto-post-scheduler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auto-post-scheduler/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [magicca](https://wordpress.org/support/users/magicca/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/problem-with-timezone-1/#post-5601632)
 * Status: resolved