You are here

function date_example_date in Date 7

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.2 date_api/date_api.module \date_example_date()

Get an example date and make sure the difference between month and day and 12 and 24 hours will be clear.

1 call to date_example_date()
_date_field_widget_settings_form in ./date_admin.inc

File

./date_admin.inc, line 487
Date administration code. Moved to separate file since there is a lot of code here that is not needed often.

Code

function date_example_date() {
  $now = date_now();
  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;
}