Server Time Problem
Moderator: mkoch227
Re: Server Time Problem
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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 56
- Joined: Wed Sep 06, 2006 11:44 pm
Re: Server Time Problem
Klemen,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!
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
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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 56
- Joined: Wed Sep 06, 2006 11:44 pm
Re: Server Time Problem
Good plan... looking forward to the resolution...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.
Thanks,
Al
Re: Server Time Problem
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?
If you change the syntax to this does it work fine in your case?
Code: Select all
m/d/Y H:i:s
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 56
- Joined: Wed Sep 06, 2006 11:44 pm
Re: Server Time Problem
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 /...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?Code: Select all
m/d/Y H:i:s


Al
Re: Server Time Problem
In that case leave the m/d/Y format in settings and try changing this in inc/common.inc.php to
Code: Select all
return date($hesk_settings['timeformat'], $dt);
Code: Select all
return str_replace('/', '-', date($hesk_settings['timeformat'], $dt) );
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 56
- Joined: Wed Sep 06, 2006 11:44 pm
Re: Server Time Problem
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!Klemen wrote:In that case leave the m/d/Y format in settings and try changing this in inc/common.inc.phptoCode: Select all
return date($hesk_settings['timeformat'], $dt);
Code: Select all
return str_replace('/', '-', date($hesk_settings['timeformat'], $dt) );