For those who prefer not to hard edit files, I released an extension a while ago that is entirely vqmod and provides a full featured setting in the store settings panel, and adds time displays to orders, etc..
http://www.opencart.com/index.php?route ... on_id=9407
http://www.opencart.com/index.php?route ... on_id=9407
Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite
irc.freenode.net #opencart
It seemed that problem in system/database/mysql.php part.
VQMOD can't change this file. I don't know why No errors.
I was happy and says that it work, but forgot to redo changes in mysql.php
May there is some professional which can describe, why it's not worked?
VQMOD can't change this file. I don't know why No errors.
I was happy and says that it work, but forgot to redo changes in mysql.php
May there is some professional which can describe, why it's not worked?
I found out why - it's because vqmod only works on files that have been loaded using the vqmod method. When you first install vqmod it updates the main index.php in OpenCart to load it's includes using vqmod as a wrapper. This is the injection mechanism for vqmod to operate. The database library script (system/library/db.php) however is not updated, but since the db.php itself CAN be updated via vqmod then we can change that so that it can then allow the mysql.php (etc) DB drivers to be vqmoddable themselves.
Anyway, the attached file has this change in it - try it out and see how it goes for you. Note that the original .xml included code to set the PHP time zone - I have removed it because it was set to an explicitly named zone (will save those people who are too lazy or don't understand the xml files). You should set the timezone in your php.ini or .htaccess file. Or put it back into the XML.
Anyway, the attached file has this change in it - try it out and see how it goes for you. Note that the original .xml included code to set the PHP time zone - I have removed it because it was set to an explicitly named zone (will save those people who are too lazy or don't understand the xml files). You should set the timezone in your php.ini or .htaccess file. Or put it back into the XML.
Whoops - my xml file broke the admin. Use this attached file instead
Why don't people just use
inside php.ini ?
http://php.net/manual/en/datetime.confi ... e.timezone
http://php.net/manual/en/timezones.php
Code: Select all
date.timezone = "Australia/Melbourne"
http://php.net/manual/en/datetime.confi ... e.timezone
http://php.net/manual/en/timezones.php
For me, for example, this didn't work :(crojo wrote:Why don't people just useinside php.ini ?Code: Select all
date.timezone = "Australia/Melbourne"
If you value your time (pun intended) and just want a solution that works, my Essentials Starter Pack v1 has local time built-in, also displays local time on dashboard and error log page for convenience, plus 20 more tweaks...
Special offer if you want to take advantage of holiday pricing. Free install and free support for anyone that asks.
Special offer if you want to take advantage of holiday pricing. Free install and free support for anyone that asks.
~
Install Extensions OR OpenCart Fast Service! PayPal Accepted
I will professionally install and configure any free or purchased theme, module or extension.
Visit http://www.mrtech.ca if you need an OpenCart webmaster
~
Thank you!
I've got vqmod installed too but didn't find such option to change..
So all in all, I only modified the system/startup.php & mysql.
Still works great! (^_^)
I've got vqmod installed too but didn't find such option to change..
So all in all, I only modified the system/startup.php & mysql.
Still works great! (^_^)
I'm using Opencart 1.5.4.1 & vQmod 2.3.2.
why not just set:
date_default_timezone_set('Europe/Rome');
ini_set('date.timezone', 'Europe/Rome');
in config.php ?
i usually use a common config.php inherited by admin and catalog config.
To set MySQL connection time_zone there is a P format for date function:
date('P') return +1:00, -03:00 etc etc
date_default_timezone_set('Europe/Rome');
ini_set('date.timezone', 'Europe/Rome');
in config.php ?
i usually use a common config.php inherited by admin and catalog config.
To set MySQL connection time_zone there is a P format for date function:
date('P') return +1:00, -03:00 etc etc
When placing an order at 14:00 in my +2:00 time zone, the default opencart installation will return 8:00 UTC, when it should be 12:00 UTC. The server is in Eastern Time in the USA. I tried both of the following:
in startup.php
date_default_timezone_set('Europe/Berlin');
in php.ini
date.timezone = Europe/Berlin;
In both options, the time returned is still 8:00 +2:00 CEST, so the hour stays the same, although the zone is updated.
I tried <?php echo date("D M j G:i:s T Y"); ?> in my header, and it shows the correct time.
I tried in mysql admin:
SET time_zone = '+2:00'; SELECT NOW(); //and the time actually shows correct at 14:00
SELECT NOW(); // shows the server time at 8:00
SELECT @@global.time_zone, @@session.time_zone; //shows both values as SYSTEM
I assume that everytime I add a date into the database with the NOW() function, I'm getting the server time. But I wonder how date.timezone = Europe/Berlin; changes the echo in my header.
in startup.php
date_default_timezone_set('Europe/Berlin');
in php.ini
date.timezone = Europe/Berlin;
In both options, the time returned is still 8:00 +2:00 CEST, so the hour stays the same, although the zone is updated.
I tried <?php echo date("D M j G:i:s T Y"); ?> in my header, and it shows the correct time.
I tried in mysql admin:
SET time_zone = '+2:00'; SELECT NOW(); //and the time actually shows correct at 14:00
SELECT NOW(); // shows the server time at 8:00
SELECT @@global.time_zone, @@session.time_zone; //shows both values as SYSTEM
I assume that everytime I add a date into the database with the NOW() function, I'm getting the server time. But I wonder how date.timezone = Europe/Berlin; changes the echo in my header.
I tried keithtb's code with the small change from "connection" to "link" and it works. I made the change to mysql.php directly, and the change to vq2_system_startup.php. Without the change to vq2_system_startup.php, I tried adding:
date.timezone = Europe/Berlin;
To php.ini in the root. This changed the zone for catalog, but admin still showed as UTC. Perhaps it should be added to the php.ini also in the admin folder, but I went ahead and just changed it in the startup.php.
Now the database is actually storing the time based on the local time of Europe/Berlin.
But it was strange that previously the time being stored was -6:00 from UTC, while the code only compares local time to UTC, which is a difference of +2:00.
But also when I enter SET time_zone = '+2:00'; SELECT NOW(); into mysql, I get the correct time. So I guess SET time_zone is an offset based on UTC.
date.timezone = Europe/Berlin;
To php.ini in the root. This changed the zone for catalog, but admin still showed as UTC. Perhaps it should be added to the php.ini also in the admin folder, but I went ahead and just changed it in the startup.php.
Now the database is actually storing the time based on the local time of Europe/Berlin.
But it was strange that previously the time being stored was -6:00 from UTC, while the code only compares local time to UTC, which is a difference of +2:00.
But also when I enter SET time_zone = '+2:00'; SELECT NOW(); into mysql, I get the correct time. So I guess SET time_zone is an offset based on UTC.
timezone settings for your region may be found here:
http://php.net/manual/en/timezones.america.php
http://php.net/manual/en/timezones.america.php
Hello, i have something to ask about this.
I've tried to change my local timezone too and on my localhost, everything is works (my location in Indonesia). All i do is change system/startup line 50 into : date_default_timezone_set('Asia/Jakarta');
But when i tried to applied the timezone on my hosting (My hosting on namecheap, server located on UK), the code doesnt work
Have tried to contact the technical support but it seems like they dont know the problem also.
Please can anybody help me about this ? Is there some additional code that i have to put on my server hosting ?
Thanks a lot before ~
I've tried to change my local timezone too and on my localhost, everything is works (my location in Indonesia). All i do is change system/startup line 50 into : date_default_timezone_set('Asia/Jakarta');
But when i tried to applied the timezone on my hosting (My hosting on namecheap, server located on UK), the code doesnt work
Have tried to contact the technical support but it seems like they dont know the problem also.
Please can anybody help me about this ? Is there some additional code that i have to put on my server hosting ?
Thanks a lot before ~
robzcuy, you might try on the server the prior syntax, gmt+8 (or so), which made sense in quite a few contexts but became deprecated when for some reason decision was made to make time model-city-based instead, during the series of php.exe 5.x releases. The server in England may be able still to use sensible gmt+/-.
Last edited by butte on Thu Nov 07, 2013 4:54 am, edited 1 time in total.
On a shared host you will not be able to reset the server's own system time, but in your host control panel there m-i-g-h-t be a setting for time offset to be used within in your account. You might be able to set php.ini for your account there. Settings made in your two php.ini files should normally be the same (/ and /admin/), but some servers ignore the php.ini files. There should be a set of server php primary error logs accessible and downloadable in the control panel. Those may tell what if anything is not right with time; probably nothing is wrong. Servers normally do stay on Standard time on Zero Longitude, taking in gmt, utc, cust, zulu, and variants, in order to stay on common time in their global network. Time offsets are made well above the operating system's kernel (where in turn time corrections may be made, and w-i-l-l be made if system admins or users notice even trivial time creep).
None of that is a fault of any version of OC. None of it is done by any version of OC except by way of any gui settings or hard code that may impose an offset. The php lingo for timezones used to be what everybody else who is serious still uses, gmt+/-n or utc/cust/zulu equivalents, but php.exe was redone to use instead region/city. Which lingo works, no matter how perfect its syntax may be, depends upon which php.exe version is in effect -- old enough php.exe will consider new time to be an error, and new enough php.exe will consider old time to be deprecated and error. Some of you will be dealing with php.exe ranging even back into 4.x or somewhere through 5.x, and will need the right vintage of tricks.
None of that is a fault of any version of OC. None of it is done by any version of OC except by way of any gui settings or hard code that may impose an offset. The php lingo for timezones used to be what everybody else who is serious still uses, gmt+/-n or utc/cust/zulu equivalents, but php.exe was redone to use instead region/city. Which lingo works, no matter how perfect its syntax may be, depends upon which php.exe version is in effect -- old enough php.exe will consider new time to be an error, and new enough php.exe will consider old time to be deprecated and error. Some of you will be dealing with php.exe ranging even back into 4.x or somewhere through 5.x, and will need the right vintage of tricks.
robzcuy, which php.exe version is running? If not, there are two quick ways to check that, control panel php settings, or phpinfo.php on your server and addressed in your browser (just as you would pinpoint index.php, phpinfo.php instead).
. . . Just went back and dredged up the link:
how: upload into /admin/, address it as http: // [...]/admin/phpinfo.php in browser address bar
file: http://forum.opencart.com/download/file.php?id=18153
. . . Just went back and dredged up the link:
how: upload into /admin/, address it as http: // [...]/admin/phpinfo.php in browser address bar
file: http://forum.opencart.com/download/file.php?id=18153
Who is online
Users browsing this forum: paulfeakins and 55 guests