function system_date_time_lookup

system_date_time_lookup()

Return the date for a given format string via Ajax.

File

modules/system/system.admin.inc, line 2204
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/config/regional/date-time/formats/lookup')) {
    return MENU_ACCESS_DENIED;
  }
  $result = format_date(REQUEST_TIME, 'custom', $_GET['format']);
  drupal_json_output($result);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.admin.inc/function/system_date_time_lookup/7.x