How to set database time zone in application.ini

前端 未结 4 2044
一生所求
一生所求 2021-02-04 02:20

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

4条回答
  •  情话喂你
    2021-02-04 02:52

    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'"
    

提交回复
热议问题