Problem with server time settings

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Problem with server time settings

Post 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.)
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Problem with server time settings

Post 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
Not getting the answer you need? CMSMS support options
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Re: Problem with server time settings

Post 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.
Locked

Return to “CMSMS Core”