Local time vs Mysql time causing publishDate issue
I recently updated a site to v 3.54 and I am experiencing a problem with publishDates which seems to stem the timezone setting in General Settings. I have the timezone set to my local timezone, which then displays local time and mysql time to be 2 hours apart (see attachment). This leads to items using the publishDate field to not appear on the site until 2 hours after intended.
Upon further research, it turns out that the above solution does not actually change the current timezone, if your MySQL is using the "SYSTEM" timezone. Unfortunately, this is very likely the case.
The next step in changing this would be to change it via your server's time, but this option varies based on your host's control panel. What control panel do you use for your hosting?
If it is cPanel, you can find instructions on how to change your server time here (https://docs.cpanel.net/whm/server-configuration/server-time/).
PHP Programmer (In Training)
I'm seeing the same issue. Luckily nothing we post is strictly time dependent, but obviously it's not ideal if the system can't adjust correctly to a set time or daylight saving times. Changing the server time is not something we have control over, so it needs to be fixable via CMSB.
We've fixed this bug for the next release. Here's some instructions if you want to manually patch your current version:
- Backup /lib/database_functions.php
- Edit /lib/database_functions.php and search for mysqli($mysqli)
- Add the code in red:
mysqli($mysqli); // save object on successful connection
// set connected flag
Let me know if that doesn't resolve the issue for you or if you need anything else.