function system_date_time_lookup in Drupal 6
Same name and namespace in other branches
- 7 modules/system/system.admin.inc \system_date_time_lookup()
Return the date for a given format string via Ajax.
1 string reference to 'system_date_time_lookup'
- system_menu in modules/
system/ system.module - Implementation of hook_menu().
File
- modules/
system/ system.admin.inc, line 1649 - Admin page callbacks for the system module.
Code
function system_date_time_lookup() {
// This callback is protected with a CSRF token because user input from the
// query string is reflected in the output.
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'admin/settings/date-time/lookup')) {
return MENU_ACCESS_DENIED;
}
$result = format_date(time(), 'custom', $_GET['format']);
drupal_json($result);
}