• Hello,

    the plugin woocommerce-pdf-invoices-packing-slip changes my time zone to utc, instead I would like to have the time zone Berlin.

    How can I change that?

    Thank you in advance.

    Many greetings,
    Vio

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Vio,
    This plugin does not modify the time zone, it simply reads the timezone from your WordPress settings (it would not be good if these settings would change by this plugin). Can I ask how you reached the conclusion that it changes the time zone? Are you seeing this issue everywhere on your site or only in the PDF invoices? If you could provide some details or an example that may help us find the root cause of your issue.

    Thread Starter viogu

    (@viogu)

    Hello @pomegranate ,
    thank you for your answer.

    The health site of my site says “The php time zone is not valid”, that’s why I talked to my host and they told me, that the time zone on the server and on wordpress is correct – But that the Plugin woocommerce-pdf-invoices-packing-slip changes it to utc.

    Can I send you a screenshot?

    Thank you!

    Many greetings,Vio

    Plugin Contributor Ewout

    (@pomegranate)

    Yes, please do (you can use https://imgbb.com for example). woocommerce-pdf-invoices-packing-slips does not change the wordpress time zone setting, it merely reads it.

    Thread Starter viogu

    (@viogu)

    Health site: https://ibb.co/yWzfNW8
    Error Log: https://ibb.co/KjYnvJd

    I understand, thank you.

    Plugin Contributor Ewout

    (@pomegranate)

    Thanks, that certainly helps. The file on our plugin where this function date_default_timezone_set is used (here), is only loaded for really old versions of WooCommerce (before 3.0). Even for those versions, that function sets the timezone back to the original eight after making transformations, so it only does this temporarily. There’s another file (here) calling this function, but here too it’s temporary and set right back to the original afterwards (and in this particular case, this is only called during the creation of a PDF file, not in the WordPress backend).
    WooCommerce does the same thing (source here). This is harmless because it’s set back to the original timezone right after making those changes.

    I think your host found that function in our plugin and assumed it was the line date_default_timezone_set( 'UTC' ); that caused the issue without looking further. But I can only conclude this happens somewhere else – your site uses WooCommerce 4.6.0 which means that the code I referred to above from our plugin is not loaded and the WooCommerce functions are used instead.

    It is more likely there is custom code on your site somewhere calling date_default_timezone_set.

    Perhaps you could ask your host for a list of all files on your site that call this function?

    Plugin Contributor Ewout

    (@pomegranate)

    By the way, the errors from the thank you page from your second screenshot (https://ibb.co/KjYnvJd) don’t seem to be related to timezone issues to me, but caused by jQuery not loading.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Howto change the time zone’ is closed to new replies.