本文整理汇总了PHP中DateTime::getDay方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTime::getDay方法的具体用法?PHP DateTime::getDay怎么用?PHP DateTime::getDay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTime
的用法示例。
在下文中一共展示了DateTime::getDay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pentecostDate
/**
* @return string
*/
private function pentecostDate() : string
{
$easterDay = $this->firstEasterDay();
$easterDay = new \DateTime($easterDay->getDay());
$pentecost = $easterDay->modify(self::$timeToCorpusChristi);
return $pentecost->format('d-m');
}
示例2: testDateTimeMicroSecondsAndOffset
public function testDateTimeMicroSecondsAndOffset()
{
$date = new DateTime('2015-04-25T19:35:20.1234+01:00');
$this->assertEquals(2015, $date->getYear());
$this->assertEquals(4, $date->getMonth());
$this->assertEquals(25, $date->getDay());
$this->assertEquals(19, $date->getHour());
$this->assertEquals(35, $date->getMinute());
$this->assertEquals(20, $date->getSecond());
$this->assertEquals(123400, $date->getMicroSecond());
$this->assertEquals(3600, $date->getOffset());
$this->assertEquals('2015-04-25T19:35:20.123400+01:00', $date->toString());
}