You are here

function date_update_5205 in Date 5.2

Same name and namespace in other branches
  1. 6 date/date.install \date_update_5205()

File

date/date.install, line 415

Code

function date_update_5205() {
  $ret = array();
  drupal_load('module', 'content');
  $fields = content_fields();
  foreach ($fields as $field) {
    if (strstr($field['type'], 'date')) {
      $field_settings = unserialize(db_result(db_query("SELECT global_settings from {node_field} where field_name = '%s'", $field['field_name'])));
      foreach ($field_settings as $key => $value) {
        if ($key == 'tz_handling' && $value == 'gmt') {
          $field_settings[$key] = 'utc';
        }
      }
      db_query("UPDATE {node_field} SET global_settings = '%s' WHERE field_name = '%s'", serialize($field_settings), $field['field_name']);
    }
  }
  return $ret;
}