Returns AM or PM, based on a given hour (in 24 hour format).
$type = Date::ampm(12); // PM $type = Date::ampm(1); // AM
string Core_Date::ampm( integer $hour )
参数列表
参数 类型 描述 默认值 $hour
integer
Number of the hour
string
public static function ampm($hour)
{
// Always integer
$hour = (int)$hour;
return ($hour > 11) ? 'PM' : 'AM';
}