1 date.inc | date_ampm($required = FALSE) |
Constructs an array of AM and PM options.
Parameters
bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE.
Return value
array: An array of AM and PM options.
File
- core/
includes/ date.inc, line 393 - Date API functions.
Code
function date_ampm($required = FALSE) {
$none = array('' => '');
$ampm = array(
'am' => t('am', array(), array('context' => 'ampm')),
'pm' => t('pm', array(), array('context' => 'ampm')),
);
return !$required ? $none + $ampm : $ampm;
}