Answers.Body: <p>Visit the civi system status check page. It will give you a link to <a href="https://dev.mysql.com/doc/refman/8.0/en/mysql-tzinfo-to-sql.html" rel="nofollow noreferrer">https://dev.mysql.com/doc/refman/8.0/en/mysql-tzinfo-to-sql.html</a>. If you can't do that, civi will still work for the foreseeable future. Also when you upgrade to 5.61 the extra logging will go away.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-08T15:42:05.010Z
Answers.Text: Thanks for the answer Demerit. The hosting company has responded to my query with: "I am sorry but unfortunately its not possible to change the timezone on the shared server, In this case I suggest you upgrade the service to our cloud or dedicated server, so that you can change it accordingly." Oh well.
Answers.UserDisplayName: The Amateur
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-11T19:52:49.523Z
Answers.Text: At Demerit's suggestion I escalated with the hosting company (hostinguk.net) after getting the same reply.  To my surprise they agreed to add timezones, so worth a try.  I used the argument that it made their shared service more attractive/useful.
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-11T21:58:12.157Z
Answers.Text: Thanks that could be a useful tip.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-07T19:47:04.600Z
Answers.LastActivityDate: 2023-04-07T19:47:04.600Z
Answers.UserDisplayName: Demerit
Body: <p>I am running CiviCRM 5.59.2 on Wordpress 6.2.</p>
  <p>I am getting an occasional error in CiviCRM that I think has something to do with a timezone not being set correctly somewhere. In my Wordpress general settings, the timezone is set to Vancouver which is where the client is located. But the error suggests that somewhere the timezone is set to Berlin. Or, perhaps, I am misunderstanding this. I'm not a programmer :-)</p>
  <p>I have spent quite a lot of time trying to figure this out, but obviously I haven't.</p>
  <p>Can anyone please help me learn how to fix this? The more specific the instructions the better :-)</p>
  <p>Thanks!</p>
  <p>This is the error from the CiviCRM log:</p>
  <pre><code>[error] $Fatal Error Details = Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; exceptionHandler
          )
  
      [code] =&gt; -14
      [message] =&gt; DB Error: no database selected
      [mode] =&gt; 16
      [debug_info] =&gt; SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]
      [type] =&gt; DB_Error
      [user_info] =&gt; SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]
      [to_string] =&gt; [db_error: message=&quot;DB Error: no database selected&quot; code=-14 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=&quot;&quot; info=&quot;SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]&quot;]
  )
  </code></pre>
  <p>This is the backtrace from the CiviCRM log:</p>
  <pre><code>bug] $backTrace = #0~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace(&quot;backTrace&quot;, TRUE)
  #1~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(945): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error-&gt;__construct(&quot;DB Error: unknown error&quot;, -1, 16, (Array:2), &quot;SET @@time_zone = \&quot;Europe/Berlin\&quot; [nativecode=1298 ** Unknown or incorrect ...&quot;)
  #3~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error-&gt;__construct(-1, 16, (Array:2), &quot;SET @@time_zone = \&quot;Europe/Berlin\&quot; [nativecode=1298 ** Unknown or incorrect ...&quot;)
  #4~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), &quot;SET @@time_zone = \&quot;Europe/Berlin\&quot; [nativecode=1298 ** Unknown or incorrect ...&quot;, &quot;DB_Error&quot;, TRUE)
  #5~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR-&gt;__call(&quot;raiseError&quot;, (Array:7))
  #6~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(943): DB_common-&gt;raiseError(-1, NULL, NULL, &quot;SET @@time_zone = \&quot;Europe/Berlin\&quot; [nativecode=1298 ** Unknown or incorrect ...&quot;, &quot;1298 ** Unknown or incorrect time zone: 'Europe/Berlin'&quot;)
  #7~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(413): DB_mysqli-&gt;mysqliRaiseError()
  #8~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli-&gt;simpleQuery(&quot;SET @@time_zone = \&quot;Europe/Berlin\&quot;&quot;)
  #9~/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common-&gt;query(&quot;SET @@time_zone = \&quot;Europe/Berlin\&quot;&quot;)
  #10~/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject-&gt;_query(&quot;SET @@time_zone = \&quot;Europe/Berlin\&quot;&quot;)
  #11~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(494): DB_DataObject-&gt;query(&quot;SET @@time_zone = \&quot;Europe/Berlin\&quot;&quot;)
  #12~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1749): CRM_Core_DAO-&gt;query(&quot;SET @@time_zone = \&quot;Europe/Berlin\&quot;&quot;, TRUE)
  #13~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/Timestamps.php(39): CRM_Core_DAO::singleValueQuery(&quot;SET @@time_zone = \&quot;Europe/Berlin\&quot;&quot;)
  #14~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component.php(76): CRM_Utils_Check_Component_Timestamps-&gt;checkTimezoneAPIs(FALSE)
  #15~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(215): CRM_Utils_Check_Component-&gt;checkAll((Array:0), FALSE)
  #16~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(185): CRM_Utils_Check::checkStatus()
  #17~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(93): CRM_Utils_Check::checkAll()
  #18~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php(255): CRM_Utils_Check-&gt;showPeriodicAlerts()
  #19~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/DashBoard.php(57): CRM_Core_Page-&gt;run()
  #20~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Contact_Page_DashBoard-&gt;run((Array:2), NULL)
  #21~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:17))
  #22~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:2))
  #23~/public_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:2))
  #24~/public_html/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress-&gt;invoke(&quot;&quot;)
  #25~/public_html/wp-includes/class-wp-hook.php(332): WP_Hook-&gt;apply_filters(&quot;&quot;, (Array:1))
  #26~/public_html/wp-includes/plugin.php(517): WP_Hook-&gt;do_action((Array:1))
  #27~/public_html/wp-admin/admin.php(259): do_action(&quot;toplevel_page_CiviCRM&quot;)
  #28 {main}
  </code></pre>
  
Tags: <error><timezone>
Title: How can I resolve what seems to be a timezone-related error?
ThreadText: # How can I resolve what seems to be a timezone-related error?
  
  (Asked by: username_0 on 2023-04-07)
  
  I am running CiviCRM 5.59.2 on Wordpress 6.2.
  
  I am getting an occasional error in CiviCRM that I think has something to do with a timezone not being set correctly somewhere. In my Wordpress general settings, the timezone is set to Vancouver which is where the client is located. But the error suggests that somewhere the timezone is set to Berlin. Or, perhaps, I am misunderstanding this. I'm not a programmer :-)
  
  I have spent quite a lot of time trying to figure this out, but obviously I haven't.
  
  Can anyone please help me learn how to fix this? The more specific the instructions the better :-)
  
  Thanks!
  
  This is the error from the CiviCRM log:
  
  ```
  [error] $Fatal Error Details = Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => exceptionHandler
          )
  
      [code] => -14
      [message] => DB Error: no database selected
      [mode] => 16
      [debug_info] => SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]
      [type] => DB_Error
      [user_info] => SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]
      [to_string] => [db_error: message="DB Error: no database selected" code=-14 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]"]
  )
  
  ```
  
  This is the backtrace from the CiviCRM log:
  
  ```
  bug] $backTrace = #0~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(945): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...")
  #3~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...")
  #4~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...", "DB_Error", TRUE)
  #5~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
  #6~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(943): DB_common->raiseError(-1, NULL, NULL, "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...", "1298 ** Unknown or incorrect time zone: 'Europe/Berlin'")
  #7~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(413): DB_mysqli->mysqliRaiseError()
  #8~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("SET @@time_zone = \"Europe/Berlin\"")
  #9~/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SET @@time_zone = \"Europe/Berlin\"")
  #10~/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("SET @@time_zone = \"Europe/Berlin\"")
  #11~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(494): DB_DataObject->query("SET @@time_zone = \"Europe/Berlin\"")
  #12~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1749): CRM_Core_DAO->query("SET @@time_zone = \"Europe/Berlin\"", TRUE)
  #13~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/Timestamps.php(39): CRM_Core_DAO::singleValueQuery("SET @@time_zone = \"Europe/Berlin\"")
  #14~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component.php(76): CRM_Utils_Check_Component_Timestamps->checkTimezoneAPIs(FALSE)
  #15~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(215): CRM_Utils_Check_Component->checkAll((Array:0), FALSE)
  #16~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(185): CRM_Utils_Check::checkStatus()
  #17~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(93): CRM_Utils_Check::checkAll()
  #18~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php(255): CRM_Utils_Check->showPeriodicAlerts()
  #19~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/DashBoard.php(57): CRM_Core_Page->run()
  #20~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Contact_Page_DashBoard->run((Array:2), NULL)
  #21~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:17))
  #22~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:2))
  #23~/public_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:2))
  #24~/public_html/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke("")
  #25~/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters("", (Array:1))
  #26~/public_html/wp-includes/plugin.php(517): WP_Hook->do_action((Array:1))
  #27~/public_html/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
  #28 {main}
  
  ```
  
  **Tags:** error, timezone
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-07. Score: 1 | Accepted answer
  
  Visit the civi system status check page. It will give you a link to <https://dev.mysql.com/doc/refman/8.0/en/mysql-tzinfo-to-sql.html>. If you can't do that, civi will still work for the foreseeable future. Also when you upgrade to 5.61 the extra logging will go away.
  
  > **Comments:**
  > **username_0**: Thanks for the answer username_1. The hosting company has responded to my query with: "I am sorry but unfortunately its not possible to change the timezone on the shared server, In this case I suggest you upgrade the service to our cloud or dedicated server, so that you can change it accordingly." Oh well.  
  > **username_2**: At username_1's suggestion I escalated with the hosting company (hostinguk.net) after getting the same reply.  To my surprise they agreed to add timezones, so worth a try.  I used the argument that it made their shared service more attractive/useful.  
  > **username_1**: Thanks that could be a useful tip.  
  
  ---
  
  