Forum

Thread tagged as: Problem, Configuration, Shop

Perch Timezones and Shop

I've set my time zone via define('PERCH_TZ', 'Australia/Perth');, and diagnostics report that as working.

However whenever a Perch order is completed, the successful order status date displays as UTC time.

Winston Grace

Winston Grace 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Where are you seeing that?

In the 'Orders' page of the Perch shop control panel, and on my confirmation order screen using:

perch_shop_order_items(
    perch_shop_successful_order_id()
);

Extended diagnostics show:

PERCH_TZ: Australia/Perth
PERCH_DATE_SHORT: %F
PERCH_TIME_SHORT: %I:%M %P

Latest order taken about 15 minutes ago, but its 7:45pm here in Perth, Australia.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is your server in the same timezone specified in your config file?

No, it would be located in Melbourne, Australia – about 3 hours ahead of Perth, Australia.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'll take a look at it.

Thanks.

If it helps, phpinfo.php gives the servers default timezone as UTC, and echoing the date in a PHP file shows UTC.

And heres some strange things when creating a brand new page:

  • Looking on the 'Dashboard' in Perch shows the date as it should be set: Perth, Australia.
  • Looking at the regions when editing the page shows 3 hours ahead of that, which I assume is Melbourne time, where the server is located.
  • Everywhere else, like 'Orders' (which is my main concern) shows UTC.
Drew McLellan

Drew McLellan 2638 points
Perch Support

Great, thanks, I'll take a look.