You are here

function date_formats_rebuild in Date 6.2

Resets the database cache of date formats, and saves all new date formats to the database.

4 calls to date_formats_rebuild()
date_api_enable in ./date_api.install
Implementation of hook_enable().
date_api_flush_caches in ./date_api.module
Implementation of hook_flush_caches().
date_api_system_modules_submit in ./date_api.module
Rebuild list of date formats when modules list is saved.
date_api_update_6004 in ./date_api.install
The "date_format" table is missing on boxes having MySQL 5.0.67 installed. There seems to be a bug in MySQL that prevents the creation of tables with a name "date_format" and indexes with the name "format".

File

./date_api.module, line 1955
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_formats_rebuild() {
  $date_formats = date_get_formats(NULL, TRUE);
  foreach ($date_formats as $format_type => $formats) {
    foreach ($formats as $format => $info) {
      date_format_save($info);
    }
  }

  // Rebuild configured date formats locale list.
  date_format_locale(NULL, NULL, TRUE);
  _date_formats_build();
}