Post by drest341 » Thu Feb 26, 2015 4:58 am

Hi folks.
I'm facing a strange issue with my db. When someone visits any page of the eshop, the time of visit is stored in date_added column of customer_online table. My problem is that always wrong time is stored, by 1h & 20min. The date is OK. For example the correct time is 13.10' but it stores 14.30'. With a custom php page i made, i can store in another table the correct time, so there is nothing to do with server time. Also if someone orders a product , same thing happens to order table.
I tryed to modify the startup.php page of system folder the date_default_timezone_set('UTC'); but no luck. When i change the value of ...`date_added` = NOW()"); in online.php page at ./catalog/model/tool folder, with
...`date_added` = 2015-02-24 13:14:54"); database is accepted the record as normal. I tryed to remove the `date_added` = NOW()"); and change table column type, from datetime to timestamp. No luck. Same wrong time is inserted again.
I use OC v.1.5.6 and same problem happens in 2 same eshops with different domain names. On clean installation there is not any mulfunction and everything is going normal with time of visit.
I believe some mod is causing this wrong time insertion, but i cannot search somewhere else to corrected. Any help is appreciated.
wrong-time1.jpg

wrong-time1.jpg (189.24 KiB) Viewed 786 times

Last edited by drest341 on Thu Feb 26, 2015 6:28 pm, edited 1 time in total.

Any fool can write code that a computer can understand. Good programmers write code that humans can understand ~ Martin Fowler.


User avatar
New member

Posts

Joined
Fri Feb 21, 2014 10:47 pm

Post by IP_CAM » Thu Feb 26, 2015 9:44 am


I'm rarely still active at the OC Forum. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'000+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by drest341 » Thu Feb 26, 2015 5:42 pm

to:IP_CAM

I tryed the first one ext., it displays the wrong time in "admin server tab" as shown in picture, but doesn't correct the problem.

Also to set it up and work, i had to modify the xml the entry in system/library/db.php
from :
"<search position="after"><![CDATA[
function query
]]></search>"

to :
"<search position="after"><![CDATA[
function query($sql) {
]]></search> "
Also in case that a new timezone is selected, never the PHPtime changes again.
wrongtime.jpg

wrongtime.jpg (89.83 KiB) Viewed 764 times


Any fool can write code that a computer can understand. Good programmers write code that humans can understand ~ Martin Fowler.


User avatar
New member

Posts

Joined
Fri Feb 21, 2014 10:47 pm

Post by drest341 » Fri Feb 27, 2015 2:09 am

Finally i recreated my DBases and in one of my eshop, time is inserted as normal. The 2nd eshop displays now 1 hour minus.
Strange. ::)

Any fool can write code that a computer can understand. Good programmers write code that humans can understand ~ Martin Fowler.


User avatar
New member

Posts

Joined
Fri Feb 21, 2014 10:47 pm
Who is online

Users browsing this forum: No registered users and 3 guests