diff --git a/CHANGES b/CHANGES index 6c738f97b..8dcf8ac76 100644 --- a/CHANGES +++ b/CHANGES @@ -1572,4 +1572,5 @@ * Fix issue where dashboard location might conflict with existing app location * Ad graphite to services * Add labels and tags to apps +* Ensure MySQL is storing data/time in UTC diff --git a/baseimage/initializeBaseUbuntuImage.sh b/baseimage/initializeBaseUbuntuImage.sh index a2d2a0bc0..2c05e71a2 100755 --- a/baseimage/initializeBaseUbuntuImage.sh +++ b/baseimage/initializeBaseUbuntuImage.sh @@ -114,6 +114,7 @@ fi echo "==> Configuring host" sed -e 's/^#NTP=/NTP=0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org/' -i /etc/systemd/timesyncd.conf timedatectl set-ntp 1 +# mysql follows the system timezone timedatectl set-timezone UTC # Disable bind for good measure (on online.net, kimsufi servers these are pre-installed and conflicts with unbound) diff --git a/setup/start/mysql.cnf b/setup/start/mysql.cnf index 8339fa901..cba076143 100644 --- a/setup/start/mysql.cnf +++ b/setup/start/mysql.cnf @@ -12,6 +12,9 @@ max_allowed_packet=32M character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci +# set timezone to UTC +default_time_zone='+00:00' + [mysqldump] quick quote-names diff --git a/src/database.js b/src/database.js index 611a1b3ca..75a87b4ac 100644 --- a/src/database.js +++ b/src/database.js @@ -36,7 +36,8 @@ function initialize(callback) { port: config.database().port, database: config.database().name, multipleStatements: false, - ssl: false + ssl: false, + timezone: 'Z' // mysql follows the SYSTEM timezone. on Cloudron, this is UTC }); gConnectionPool.on('connection', function (connection) {