I have an application in Zend Framework that has to run for a different time zone than the server. Is there an option to set the database server (MySQL in this case) time zone i
you might as well consider adding it on your bootstrap:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initTimeZone() {
date_default_timezone_set('Asia/Manila');
}
}
Try build pre dispatch plugin and get data from config file for query
I'm answering my own question just to close this, as the response is already in one of the edits.
resources.db.params.charset
and
resources.db.params.driver_options.1002
as I had in my application.ini cannot be used together, as resources.db.params.charset
ovewirites driver_options.1002
.
If you need to set the timezone, remove resources.db.params.charset
and pass the timezone in the charset in driver_options
.
E.g.:
resources.db.params.driver_options.1002 = "SET NAMES utf8, time_zone = 'Europe/London'"
This works for me:
resources.db.adapter = "Pdo_Mysql"
resources.db.params.driver_options.1002 = "SET NAMES 'utf8', CHARACTER SET 'utf8', time_zone = 'Europe/London'"