选择语言 :

 Core_Date::ampm

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
File: ./core/classes/date.class.php
public static function ampm($hour)
{
    // Always integer
    $hour = (int)$hour;

    return ($hour > 11) ? 'PM' : 'AM';
}