Time zones should be in sync even if database server is set to different time zone from server with application (PHP)
PHP and MySQL may be running on different servers, and the clocks may be out-of-sync. Configuring automatic clock synchronization is the best solution.
It's not clear how necessary it is for CiviCRM to rely on the database server's time zone. This causes issues on Pantheon since there is no guarantee the database server is in the same location as the app server. The database server is set to use UTC. One can override it with
SET @@global.time_zone = '-04:00' or whatever, but this is only temporary. Pantheon migrates databases between servers as upgrades are rolled out. The new server has the default settings. So we can't rely on setting that and Pantheon is currently not planning to allow changes to that configuration in a file.
In core (per CMS integration) the database time zone is set each database session. Such as with
CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone(); in civicrm.module. But this doesn't help in the case with Pantheon. (I'm not entirely sure why).
But it's not really clear why it needs to be done this way. Could CiviCRM instead take the same approach as Drupal/Backdrop by saving all dates as UTC and then convert them to the CMS' timezone for display? Isn't that more robust?