WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Woocommerce not using site time and date (3 posts)

  1. liberius
    Member
    Posted 9 months 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.

    http://wordpress.org/plugins/woocommerce/

  2. varktech.com
    Member
    Posted 9 months ago #

    Hi,
    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
    Member
    Posted 9 months ago #

    Thanks.

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.