[resolved] Woocommerce not using site time and date (3 posts)

  1. liberius
    Posted 2 years ago #

    My time zone is Auckland, New Zealand. Both Woocommerce and WordPress are correctly set to this time zone.

    The server is based in California which is 21 hours behind.

    I've confirmed that WordPress is using the correct local time zone as a call to the current_time function outputs the correct local time in Auckland and not in California.

    But when I set a sale price start date in Woocommerce, it seems to be using the server time. I've confirmed this by changing the sale price start date to one day earlier and sure enough the sale price is now active.

    Is this a bug in Woocommerce or am I missing something?

    Thanks in advance.


  2. vark
    Posted 2 years ago #

    I believe you can repair the situation by placing something like the following in your theme's functions.php file:

    add_action( 'init', create_function( '', "date_default_timezone_set('Pacific/Auckland');" ) );

    Untested, ymmv.

  3. liberius
    Posted 2 years ago #


    It's the strangest thing. About an hour after I confirmed both timezone settings things finally sorted themselves out. Woocommerce now sees the timezone correctly.

    Perhaps that will help others. Wait a while and see if you just don't have a delay.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.