Answers.Body: <p>I have a similar setup running Drupal 6 and CiviCRM 4.7.25. My system also showed <a href="https://civicrm.stackexchange.com/questions/14848/system-status-page-empty-and-status-remains-critical-after-updating-from-4-7-8"><strong>System Status: Critical</strong> and no messages</a>. The issue was is that it first attempts to set the time zone and if that fails it doesn't output any further messages for some reason.</p>
  
  <p>In CiviCRM version 4.7.25 you can use the API console to run the System.check action by visiting <code>http://sitename/civicrm/api#explorer</code> and choosing Entity <code>System</code> and action <code>check</code> to repeat this test while you edit the files.</p>
  
  <p>The fix is to fix the time zone problem which inherits from the Drupal 6 user and sets (in my case) an invalid time zone string which creates this issue.</p>
  
  <p>For instances with <strong>Drupal 6</strong>, it uses the method <code>CRM_Utils_System_Drupal6::getTimeZoneString()</code> which retrieves the time zone from the user's <code>timezone</code> member in the database, which in my case is the offset in seconds, or a string <code>-14400</code> for Eastern Time.</p>
  
  <p>The problem is the <code>DateTimeZone</code> code which converts this into a database time zone string supports offsets in <em>hours</em>, not <em>seconds</em>, so I added this code to detect and adjust the values, use at your own risk:</p>
  
  <pre><code>--- Drupal6.php (revision 4843)
  +++ Drupal6.php (working copy)
  @@ -754,6 +754,9 @@
       // Note that 0 is a valid timezone (GMT) so we use strlen not empty to check.
       if (variable_get('configurable_timezones', 1) &amp;&amp; $user-&gt;uid &amp;&amp; isset($user-&gt;timezone) &amp;&amp; strlen($user-&gt;timezone)) {
         $timezone = $user-&gt;timezone;
  +     if (is_numeric($timezone) &amp;&amp; $timezone % 3600 === 0 &amp;&amp; abs($timezone) &gt;= 3600) {
  +         $timezone = intval($timezone / 3600);
  +     }
       }
       else {
         $timezone = variable_get('date_default_timezone', NULL);
  </code></pre>
  
  <p>Once I patched this, the check step works correctly and I can review the further messages we're getting. Another trick here, by the way, is to update <code>CRM_Utils_Check::CHECK_TIMER</code> in <code>sites/all/modules/civicrm/CRM/Utils/Check.php</code> to a small number while you're debugging, otherwise the checks update only once a day.</p>
  
  <p>As always, use best practices when working on production systems and back up all source files before modifying them.</p>
  
  <p>The other possible place to look is in the Drupal <code>variables</code> table for the named value <code>date_default_timezone</code> which is used if the user does not have a time zone configured.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T23:20:44.013Z
Answers.LastActivityDate: 2017-11-02T23:20:44.013Z
Answers.UserDisplayName: razzed
Body: <p>I'm getting error "Error: DateTimeZone::__construct: Unknown or bad timezone (7200)" when opening CiviCRM on my Drupal6 site. Refreshing the page clears the error. The error occurred after I upgraded to D6.38 and Civi4.7.11.
  My timezone is Africa/Johannesburg. Any ideas?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-12T20:48:35.757Z
Comments.Text: * This is not an answer - I don't have the reputation needed to comment @davy-ivins are you also finding that the system status page is broken? I am also getting Timezone errors after updating to 4.7.11 on Drupal 6 and trying to determine if they are the cause of the issue with the system status. Ref: http://civicrm.stackexchange.com/questions/14848/system-status-page-empty-and-status-remains-critical-after-updating-from-4-7-8
Comments.UserDisplayName: freeform.steph
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-11T22:08:05.930Z
Comments.Text: I am also seeing the same error message after upgrading from CiviCRM 4.7.9 to 4.7.11, and still persists at 4.7.12 also on Drupal 6.x. Suspecting a defect got into CiviCRM between versions 4.7.9 and 4.7.11. Our error message is as follows: Sorry but we are not able to provide this at the moment. DateTimeZone::__construct(): Unknown or bad timezone (-18000) Also the following shows up in the civicrm log file at the time of the error: Nov 11 16:47:55 [info] $Fatal Error Details = array(3) { ["message"]=> string(61) "DateTimeZone::__construct(): Unknown or bad timezone (-14400)" ["code"]=> NULL [
Comments.UserDisplayName: Michael Lueck
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-11T21:12:53.660Z
Comments.Text: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](http://civicrm.stackexchange.com/questions/ask). You can also [add a bounty](http://civicrm.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/5835)
Comments.UserDisplayName: petednz - fuzion
Tags: <timezone><drupal-6>
Title: Error: DateTimeZone::__construct: Unknown or bad timezone (7200)
ThreadText: # Error: DateTimeZone::__construct: Unknown or bad timezone (7200)
  
  (Asked by: username_0 on 2016-09-12)
  
  I'm getting error "Error: DateTimeZone::\_\_construct: Unknown or bad timezone (7200)" when opening CiviCRM on my Drupal6 site. Refreshing the page clears the error. The error occurred after I upgraded to D6.38 and Civi4.7.11.
  My timezone is Africa/Johannesburg. Any ideas?
  
  **Tags:** timezone, drupal-6
  
  > **Comments:**
  > **username_1**: * This is not an answer - I don't have the reputation needed to comment @username_0-username_0 are you also finding that the system status page is broken? I am also getting Timezone errors after updating to 4.7.11 on Drupal 6 and trying to determine if they are the cause of the issue with the system status. Ref: http://civicrm.stackexchange.com/questions/14848/system-status-page-empty-and-status-remains-critical-after-updating-from-4-7-8  
  > **username_2**: I am also seeing the same error message after upgrading from CiviCRM 4.7.9 to 4.7.11, and still persists at 4.7.12 also on Drupal 6.x. Suspecting a defect got into CiviCRM between versions 4.7.9 and 4.7.11. Our error message is as follows: Sorry but we are not able to provide this at the moment. DateTimeZone::__construct(): Unknown or bad timezone (-18000) Also the following shows up in the civicrm log file at the time of the error: Nov 11 16:47:55 [info] $Fatal Error Details = array(3) { ["message"]=> string(61) "DateTimeZone::__construct(): Unknown or bad timezone (-14400)" ["code"]=> NULL [  
  > **username_3**: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](http://civicrm.stackexchange.com/questions/ask). You can also [add a bounty](http://civicrm.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/5835)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2017-11-02. Score: 1
  
  I have a similar setup running Drupal 6 and CiviCRM 4.7.25. My system also showed [**System Status: Critical** and no messages](https://civicrm.stackexchange.com/questions/14848/system-status-page-empty-and-status-remains-critical-after-updating-from-4-7-8). The issue was is that it first attempts to set the time zone and if that fails it doesn't output any further messages for some reason.
  
  In CiviCRM version 4.7.25 you can use the API console to run the System.check action by visiting `http://sitename/civicrm/api#explorer` and choosing Entity `System` and action `check` to repeat this test while you edit the files.
  
  The fix is to fix the time zone problem which inherits from the Drupal 6 user and sets (in my case) an invalid time zone string which creates this issue.
  
  For instances with **Drupal 6**, it uses the method `CRM_Utils_System_Drupal6::getTimeZoneString()` which retrieves the time zone from the user's `timezone` member in the database, which in my case is the offset in seconds, or a string `-14400` for Eastern Time.
  
  The problem is the `DateTimeZone` code which converts this into a database time zone string supports offsets in *hours*, not *seconds*, so I added this code to detect and adjust the values, use at your own risk:
  
  ```
  --- Drupal6.php (revision 4843)
  +++ Drupal6.php (working copy)
  @@ -754,6 +754,9 @@
       // Note that 0 is a valid timezone (GMT) so we use strlen not empty to check.
       if (variable_get('configurable_timezones', 1) && $user->uid && isset($user->timezone) && strlen($user->timezone)) {
         $timezone = $user->timezone;
  +     if (is_numeric($timezone) && $timezone % 3600 === 0 && abs($timezone) >= 3600) {
  +         $timezone = intval($timezone / 3600);
  +     }
       }
       else {
         $timezone = variable_get('date_default_timezone', NULL);
  
  ```
  
  Once I patched this, the check step works correctly and I can review the further messages we're getting. Another trick here, by the way, is to update `CRM_Utils_Check::CHECK_TIMER` in `sites/all/modules/civicrm/CRM/Utils/Check.php` to a small number while you're debugging, otherwise the checks update only once a day.
  
  As always, use best practices when working on production systems and back up all source files before modifying them.
  
  The other possible place to look is in the Drupal `variables` table for the named value `date_default_timezone` which is used if the user does not have a time zone configured.
  
  
  ---
  
  