AbanteCart Community

eCommerce construction => How-to questions => Topic started by: morangup on July 30, 2017, 07:40:53 PM

Title: Incorrect time- displayed in UTC
Post by: morangup on July 30, 2017, 07:40:53 PM
Help.. what am I missing here?

Date added is displayed in UTC... however the required is UTC+8 (Perth/Australia)
The store zone is correct, and php.ini has all the required
Admin console displays the Server time in the correct date and time!


<tbody><tr>
               <th class="align_left">Date Added</th>
               <th class="align_left">Status</th>
               <th class="align_left">Customer's order comment</th>
            </tr>
                           <tr>
                  <td class="valign_top">30/07/2017 01:30:21 PM</td>

Title: Re: Incorrect time- displayed in UTC
Post by: Basara on July 31, 2017, 03:08:32 AM
Hello.

On what page you see issue?
Title: Re: Incorrect time- displayed in UTC
Post by: morangup on July 31, 2017, 03:13:14 AM
index.php?rt=account/invoice&order_id=


index.php?rt=sale/order/details&order_id=
Title: Re: Incorrect time- displayed in UTC
Post by: abolabo on July 31, 2017, 03:26:41 AM
on order page you see time from mysql-database. Please check it via phpMyAdmin.
Probably mysql server time zone  is wrong, not php.
Title: Re: Incorrect time- displayed in UTC
Post by: morangup on July 31, 2017, 03:40:26 AM
is there no conversion to the coordinated zone in this component of abantecart?
Title: Re: Incorrect time- displayed in UTC
Post by: abolabo on July 31, 2017, 04:10:45 AM
good question.
not yet.
It's a server-side configuration.

You can try set timezone via Abantecart database driver.
Just open your core/database/amysqli.php file
and add this line
Code: [Select]
$connection->query("SET GLOBAL time_zone = 'Perth/Australia';");after
Code: [Select]
$connection->query("SET SESSION SQL_BIG_SELECTS=1;");
Title: Re: Incorrect time- displayed in UTC
Post by: morangup on July 31, 2017, 04:16:42 AM
Cheers... yep tried that.. sadly it hasn't transpired as yet. I'll keep trying a few different models until the solution is found!

Thanks for your help.  :)

Best Regards Dave
Title: Re: Incorrect time- displayed in UTC
Post by: morangup on July 31, 2017, 05:06:06 AM
What a shame that all this effort has gone into this project yet unfortunately Abantecart in it's current form is unsatisfactory for use in shared hosting environment where the global mysql database timezone is not to be changed.  (for obvious reasons)

Hopefully this slight oversight will be corrected in the future.




Title: Re: Incorrect time- displayed in UTC
Post by: abantecart on July 31, 2017, 09:26:21 AM
This is not AbanteCart issue. This is a a pure server configurations related topic. You can configure your server to use time zone as you desire.

This is done on your hosting. Here is the example:
http://www.inmotionhosting.com/support/website/php/setting-the-timezone-for-php-in-the-phpini-file

Also you can set time zone on the database as well:
https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html

We can consider adding configuration setting in AbanteCart to help with this, but eCommerce application should not be controlling your server settings.
Title: Re: Incorrect time- displayed in UTC
Post by: morangup on July 31, 2017, 10:09:45 AM
Abantecart are you saying this can be done on a Shared hosting environment without affecting other users. If so please specify exactly how to do this so I can relay the information to the network engineers?
Title: Re: Incorrect time- displayed in UTC
Post by: abantecart on August 02, 2017, 02:31:16 PM
System time and time zone are set on the hosted server side. You need to check your hosting or contact them directly. I posted links to articles with the help in prior post.
Title: Re: Incorrect time- displayed in UTC
Post by: scottwww on August 25, 2017, 11:17:10 PM
This is done on your hosting. Here is the example:
....inmotionhosting.com/support/website/php/setting-the-timezone-for-php-in-the-phpini-file
It looks like this might have worked to resolve this for me.  I added this to my php.ini file found in the directory where AbanteCart resides:

date.timezone = "America/Boise"