Page 2 of 2
Re: Server Time Problem
Posted: Mon Jan 07, 2013 5:39 pm
by Klemen
According to PHP manual, the notices for incorrect timezone settings are shown since PHP 5.1.0, so the most likely issue is your host doesn't have a (correct) timezone set in their PHP 5.4 php.ini file.
Re: Server Time Problem
Posted: Sat Jul 27, 2013 1:03 pm
by allawrence
Klemen wrote:Ha, I think I found the problem - the PHP "strtotime" function didn't work properly when time format was "m-d-Y H:i:s".
I changed it to "d-m-Y H:i:s" - switched d (day) and m (month) and it works correctly now.
This probably happens because of the default timezone setting on the server that uses "day month" format instead of "month day".
It's the first time I ever saw this error, thanks for giving me access so I was able to figure it out!
Klemen,
Installed 2.5 version... this problem appears to have not been resolved... I did change the format of the date and got it to react correctly, however, the date format is not the desirable one for the US....
Do hope this can be resolved
Al
Re: Server Time Problem
Posted: Sun Jul 28, 2013 3:53 pm
by Klemen
Thanks for the heads up - will see if I can come up with something more robust rather than relying on php.ini settings for the future.
Re: Server Time Problem
Posted: Sun Jul 28, 2013 3:59 pm
by allawrence
Klemen wrote:Thanks for the heads up - will see if I can come up with something more robust rather than relying on php.ini settings for the future.
Good plan... looking forward to the resolution...
Thanks,
Al
Re: Server Time Problem
Posted: Wed Aug 07, 2013 12:38 pm
by Klemen
I'm looking into this now. According to PHP manual, "XX-XX-XXXX" is treated as UK format whereas "XX/XX/XXXX" is treated as US format.
If you change the syntax to this does it work fine in your case?
Re: Server Time Problem
Posted: Wed Aug 07, 2013 2:16 pm
by allawrence
Klemen wrote:I'm looking into this now. According to PHP manual, "XX-XX-XXXX" is treated as UK format whereas "XX/XX/XXXX" is treated as US format.
If you change the syntax to this does it work fine in your case?
It appears as if that resolved the problem... date and time are displaying correctly... good find... not in UK, but still like the - instead of the /...
Al
Re: Server Time Problem
Posted: Wed Aug 07, 2013 3:46 pm
by Klemen
In that case leave the m/d/Y format in settings and try changing this in inc/common.inc.php
Code: Select all
return date($hesk_settings['timeformat'], $dt);
to
Code: Select all
return str_replace('/', '-', date($hesk_settings['timeformat'], $dt) );
Re: Server Time Problem
Posted: Wed Aug 07, 2013 4:11 pm
by allawrence
Klemen wrote:In that case leave the m/d/Y format in settings and try changing this in inc/common.inc.php
Code: Select all
return date($hesk_settings['timeformat'], $dt);
to
Code: Select all
return str_replace('/', '-', date($hesk_settings['timeformat'], $dt) );
Thank you for the code... However, since I don't like to make code changes (since I inevitably will forget to make changes when new releases come out) I will have to give some thought to making the change!