本文整理汇总了PHP中Time::getHour方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::getHour方法的具体用法?PHP Time::getHour怎么用?PHP Time::getHour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time::getHour方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTimeMicroSecondsAndOffset
public function testTimeMicroSecondsAndOffset()
{
$time = new Time('19:35:20.1234+01:00');
$this->assertEquals(19, $time->getHour());
$this->assertEquals(35, $time->getMinute());
$this->assertEquals(20, $time->getSecond());
$this->assertEquals(123400, $time->getMicroSecond());
$this->assertEquals(3600, $time->getOffset());
$this->assertInstanceOf('DateTimeZone', $time->getTimeZone());
$this->assertEquals('19:35:20.123400+01:00', $time->toString());
}
示例2: getHour
/**
* Gets the hours of the Timestamp object
*
* @return int
*/
function getHour()
{
return $this->time->getHour();
}