You are here

function date_show_date in Date 5

A function to display formatted output for the date object

Parameters

$date - the date object: @param $format_string - the format string to be used for the display @param $type - 'local' or 'db', the date value to be displayed

4 calls to date_show_date()
date_format_item in ./date.module
Use the Date API to return the formatted value for a date object.
date_output_options in ./date.inc
Function to create an option list that will display various date and time formats
date_select_input in ./date.inc
Flexible Date/Time Drop-Down Selector
_date_token_values in ./date_token.inc

File

./date.inc, line 437
Date/time API functions

Code

function date_show_date($date, $format_string, $type = 'local') {
  if ($type == 'db' || !$date->local->timestamp && $date->local->timestamp != 0) {
    return date_format_date($format_string, date_fuzzy_stamp($date->db), $date->local->offset, $date->local->timezone) . $append;
  }
  elseif ($date->local->timestamp || $date->local->timestamp == 0) {
    return date_format_date($format_string, date_fuzzy_stamp($date->local), $date->local->offset, $date->local->timezone) . $append;
  }
}