admin/orders.php displays the purchase date and time according to the time zone that the server is set to.
Is there a way to adjust the displayed date and time to make it display according to the time zone of the store owner?
Displayed purchased time on admin/orders.php
-
- VIP Member
- Posts: 2030
- Joined: Mon Oct 07, 2019 4:39 am
- : Buy Me A Beverage
- Has thanked: 28 times
- Been thanked: 187 times
Re: Displayed purchased time on admin/orders.php
Just guessing but could this be done by changing in configure files?
e.g.
change
to
e.g.
change
Code: Select all
date_default_timezone_set(date_default_timezone_get());
Code: Select all
date_default_timezone_set('America/Los_Angeles');
Re: Displayed purchased time on admin/orders.php
I just tried that, and it results in a 500 internal server configuration error.
Re: Displayed purchased time on admin/orders.php
Thanks for the suggestions. Whether I put your suggested code in configure.php or in orders.php, a test order's email notifications have the correct time on them whether your suggested code is added or not, but the dates generated by orders.php are an hour off whether your suggested code is added or not.heatherbell wrote: ↑Wed Mar 30, 2022 4:30 pm Just guessing but could this be done by changing in configure files?
e.g.
changetoCode: Select all
date_default_timezone_set(date_default_timezone_get());
Code: Select all
date_default_timezone_set('America/Los_Angeles');
I think the issue is how the date and time are stored in the database, and whether the existing Phoenix code does any manipulation of the time values retrieved from the database. If there is no manipulation of the stored values, I think it's going to be off when the store is not in the same time zone as the server.
If in admin/includes/actions/orders/views/default.php I change
Code: Select all
return $row['date_purchased'];
Code: Select all
return date('Y-m-d H:i:s', strtotime($row['date_purchased']) - 3600);