concretecms / concrete5-legacy

Legacy repository for concrete5
http://www.concrete5.org
559 stars 323 forks source link

Update MySQL timezone if APP_TIMEZONE is defined #1918

Closed littleibex closed 8 years ago

littleibex commented 9 years ago

If APP_TIMEZONE is defined by the user in config/site.php, the PHP/Apache timezone for the app is updated in concrete/startup/timezone.php. However, the timezone of the database is still the same as that of the server. This way the same application has different timezone for PHP and a different timezone for the database. This is a source of bug and not a complete solution for providing the feature to set the timezone of the app.

This commit sets the timezone of the database to what is defined in APP_TIMEZONE when the database object is initialised, so that the Apache and MySQL timezone for that particular app remain the same.

Remo commented 9 years ago

@mlocati you've got more knowledge in this area and afaik you're running some sites with timezones. Ever ran into this issue?

Mnkras commented 9 years ago

@remo I actually ran into this recently when a server's timezone changed.

I think this might break the time on any sites that currently use APP_TIMEZONE though, or implemented it later in site development.

littleibex commented 8 years ago

Not applicable to the latest legacy version of concrete5. The pull request got corrupted by another commit.