Page 1 of 1

Problem with server time settings

Posted: Mon Apr 06, 2020 9:29 pm
by Charles Butcher
Could someone give me some advice about server times, please? When I post a new news article, it doesn't appear in the sidebar until after a delay. I'm in England, where we recently changed to daylight saving time. That seems to be the problem, but I don't know how to fix it.

I tried the diagnostics in Rolf and Robert's article:https://cmscanbesimple.org/blog/server-time-difference. The diagnostic UDT named "test_server_timezones" gives:

Code: Select all

PHP time is '2020-04-06 20:55:48'
MySQL time is '2020-04-06 19:55:48'
My config.php has:

Code: Select all

$config['timezone'] = 'Europe/London';
Adding:

Code: Select all

$config['set_db_timezone'] = 'Europe/London';
(or Europe/Amsterdam) has no effect. Do I need to take this up with my hosting company instead?

(The other three tests mentioned in that article are all fine. The UNIX timestamp is correct, and the UDTs "test_db_timedifference" and "test_file_timedifference" both show zero offset.)

(I tried to ask this question in the obvious place, at the bottom of the original article, but I was defeated by Rolf's anti-spam system.)

Re: Problem with server time settings

Posted: Mon Apr 06, 2020 9:48 pm
by DIGI3
The set_db_timezone config entry is a true or false. Try setting it to TRUE, that should solve your problem:

Code: Select all

$config['set_db_timezone'] = true;
https://docs.cmsmadesimple.org/configur ... b_timezone

Re: Problem with server time settings

Posted: Mon Apr 06, 2020 9:55 pm
by Charles Butcher
Thanks so much, and sorry for not RTFM.

I did previously see Gregory Prosser's comment beneath that article, and I tried setting it to "1" (and "0"). That just broke the site.

"true" it is, then, and all looks good now. Much appreciated.