Page 1 of 1
Notification email - wrong time
Posted: Wed Sep 19, 2012 2:32 pm
by haken
Script URL: pomoc.solidexpert.com
Version of script: 2.4.1
Hosting company: GoDaddy
URL of phpinfo.php:
http://www.solidexpert.com/info.php
URL of session_test.php:
What terms did you try when SEARCHING for a solution: timezone server
Write your message below:
I needed to add 9 hours to server time to get correct HESK time. All events in Hesk are recorded properly with correct local time. The problem is with notification emails. All are sent with doubled timediff value.
Eg. Server time: 01:00
Hesk time : 10:00 (my local time)
Notification email time signature: 19:00
Customers see it as e-mail from future, their spam rules often delete those emails at once. Problem is both for phpmail and smtp
Is there a possibility to change some line of code to fix this? I see no chance to modify godaddy.com php.ini...
I understand that would be no problem if server time = hesk time (difference 0)
Re: Notification email - wrong time
Posted: Wed Sep 19, 2012 4:01 pm
by haken
Ok. I have manage to edit php.ini file.
Now hesk time = server time, difference 0.
BUT all timestamps in hesk are moved -9 hours (despite good hesk time!). Is it a problem with mySQL date records? There is for sure no option to edit timezone for mysql on GoDaddy servers...
Please help;)
Re: Notification email - wrong time
Posted: Wed Sep 19, 2012 5:25 pm
by Klemen
It's possible that their MySQL is set to a different time zone. I'm afraid I cannot help here.
However, emails shouldn't be blocked because of few hours time difference, SPAM filters should take in account that servers are in different time zones over the world.
Re: Notification email - wrong time
Posted: Thu Sep 20, 2012 10:07 am
by haken
Thanks for clearing things out!
I found a SQL statement for changing sql session timezone and I try to put it somewhere
Eg. in admin_ticket.php it works partially (change only last update date). This is strange.
I hoped for easy mods in admin_ticket.php and ticket.php
Code: Select all
$res = hesk_dbQuery("SET time_zone = `Europe/Warsaw`");
Is there a place to put this SQL statement that all dates collected from tables would be got in correct tomezone?
Re: Notification email - wrong time
Posted: Thu Sep 20, 2012 3:45 pm
by Klemen
You can try adding it just above this code in inc/database.inc.php
Re: Notification email - wrong time
Posted: Sat Nov 24, 2012 10:26 pm
by vewert
I am having a similar problem.
haken,
Did you have any success setting the Time Zone in the SQL Statement?
I added:
Code: Select all
$res = hesk_dbQuery("SET time_zone = '-8:00';");
to database.inc.php, which sets it to PST, which is my local Time Zone.
This initially seemed to work, now all the timestamps in the tickets were showing correctly as PST. I then wondered what would happen for customers logging Tickets from other Time Zones. On a Test machine, I set the System Timezone to CST (-6:00), and added some replies to a ticket and found that the timestamps always showed as PST even for the computer set to CST. So, the way I have it now is:
Emails seems to show correct time
Timestamps in the client also show the time in PST, regardless of the timezone of the client.
Shouldn't the client always show the timestamps of the user's local Time Zone, regardless of the Time Zone of the database?
Any ideas?
Thanks,
Re: Notification email - wrong time
Posted: Mon Nov 26, 2012 4:29 pm
by Klemen
The timestamp in HESK is always the server timestamp (corrected for example to the timezone your company is in if you use the adjust time settings), never client's.
Re: Notification email - wrong time
Posted: Mon Nov 26, 2012 6:03 pm
by vewert
Thanks, klemen for the quick reply.
So, just so I'm clear. If my server is in EST, and a Customer submits a ticket in PST, when the customer views their ticket in their browser, all timestamps will be displayed in EST.
I guess what I expected was, that the database would store the timestamp in some 'Time Zone neutral' format and then the browser would display the timestamps in the user's/browser's local Time Zone. I guess the issue with that is, trying to determine the Time Zone of the browser client.
Re: Notification email - wrong time
Posted: Mon Nov 26, 2012 7:51 pm
by Klemen
Exactly, in your example timestamp will be displayed in EST and yes, detecting timezone is indeed the issue here. If you have a system that requires users to login you can ask them what their timezone is, but Hesk was designed not to use any login hence there is no reliable way of detecting the timezone.
Re: Notification email - wrong time
Posted: Mon Nov 26, 2012 8:37 pm
by vewert
OK, thanks. Now that I understand how it works, I can work around it.