3

I have been unable to get the CiviCRM warning about timezone settings corrected after this just past daylight savings transition. Usually I would correct it by changing the timezone setting of the Drupal user ID's. In the past, the user's timezone setting would be an hour off to the real time, so adjusting the timezone setting in Drupal back to current time always corrected the issue. However this time the user timezone setting already was correct.

I have written up the following PHP tester:

<?php

$db = new mysqli('localhost', 'dbuserid', 'blablablapassword', 'db');

if($db->connect_errno > 0){
  die('Unable to connect to database [' . $db->connect_error . ']');
}

$sql = <<<SQL
    SELECT NOW() AS `NOW`
SQL;

if(!$result = $db->query($sql)){
  die('There was an error running the query [' . $db->error . ']');
}

while($row = $result->fetch_assoc()){
  echo 'MySQLi date: ' . $row['NOW'] . '<br />';
}

$result->free();

echo 'PHP date: ' . date('Y-m-d H:i:s');

?>

Which outputs:

MySQLi date: 2015-05-26 21:32:56
PHP date: 2015-05-26 21:32:56

Looks like they match to me.

I have also hard coded set the timezone into the Apache virtual site's configuration by adding to the site's .htaccess file:

  #Added PHP Timezone information to match Linux configuration
  php_value date.timezone "America/New_York"

Where else could be causing CiviCRM to complain thusly:

Environment Settings
Timestamps reported by MySQL (eg "2015-05-26 21:28") and PHP (eg "2015-05-26 20:28" ) are mismatched.
Read more about this warning

I am thankful, Michael

3

I know you said you checked the user's timezone but did you check the sitewide time zone in Drupal at /admin/config/regional/settings?

  • Thank you, frTommy, that is already set correct as well... the Drupal site-wide timezone setting. Since "all of these settings" are still correct after the last daylight savings change, I wonder if the settings were incorrect before the change yet CiviCRM was not siting the error? – Michael Lueck May 28 '15 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.