Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-15656

Synchronize PHP and MySQL time zones


    • Documentation Required?:
      User and Admin Doc
    • Sprint:
      4.7.11 Security
    • Funding Source:
      Contributed Code


      CiviCRM detects a mismatch between the PHP and MySQL time zones. We are in a shared hosting environment where the system and MySQL time zone is different to the one we want to use in PHP, so we get warning messages and there are time stamp issues. We do not have the necessary rights on MySQL to change its time zone globally, so it seems more sensible to do it on a session by session basis. I noticed that CRM/Core/DAO.php seems to do a SET NAMES utf8 each time it sets up a connection to the database. It would therefore seem sensible to change the time zone at that point, too. You CiviCRM experts may see a problem with this, but I offer this diff file (from 4.5.4) in case it is helpful. You may want it to be a setting you configure in the global setup, but my knowledge doesn't run to that.


        1. Base.patch
          0.5 kB
          Stephen Palmstrom
        2. Base.patch
          1 kB
          Stephen Palmstrom
        3. CivCRMAdmin.patch
          0.4 kB
          Stephen Palmstrom
        4. civicrmadmin.patch
          0.3 kB
          Stephen Palmstrom
        5. CiviCRMFrontend.patch
          0.5 kB
          Stephen Palmstrom
        6. civicrmuser.patch
          0.5 kB
          Stephen Palmstrom
        7. DAO.diff
          0.7 kB
          Stephen Palmstrom
        8. DAO4.6.9.diff
          1 kB
          Stephen Palmstrom
        9. Joomla.patch
          0.8 kB
          Stephen Palmstrom
        10. Joomla.patch
          1 kB
          Stephen Palmstrom



            • Assignee:
              monish.deb Monish Deb
              spalmstr Stephen Palmstrom
            • Votes:
              0 Vote for this issue
              6 Start watching this issue


              • Created: