You are here

function date_example_date in Date 7.2

Same name and namespace in other branches
  1. 8 date_api/date_api.module \date_example_date()
  2. 5.2 date/date_admin.inc \date_example_date()
  3. 6.2 date/date_admin.inc \date_example_date()
  4. 6 date/date_admin.inc \date_example_date()
  5. 7.3 date_api/date_api.module \date_example_date()
  6. 7 date_admin.inc \date_example_date()

Creates an example date.

This ensures a clear difference between month and day, and 12 and 24 hours.

5 calls to date_example_date()
date_format_type_options in date_api/date_api.module
Creates an array of date format types for use as an options list.
date_popup_process_date_part in date_popup/date_popup.module
Process the date portion of the element.
date_text_element_process in date_api/date_api_elements.inc
Text date input form.
date_views_argument_handler_simple::options_form in date_views/includes/date_views_argument_handler_simple.inc
Build the options form.
_date_field_widget_settings_form in ./date_admin.inc
Helper function for date_field_widget_settings_form().

File

date_api/date_api.module, line 2889
This module will make the date API available to other modules.

Code

function date_example_date() {
  $now = date_now();
  if (date_format($now, 'M') == date_format($now, 'F')) {
    date_modify($now, '+1 month');
  }
  if (date_format($now, 'm') == date_format($now, 'd')) {
    date_modify($now, '+1 day');
  }
  if (date_format($now, 'H') == date_format($now, 'h')) {
    date_modify($now, '+12 hours');
  }
  return $now;
}