DatePeriod::getStartDate
(PHP 5 >= 5.6.5, PHP 7, PHP 8)
DatePeriod::getStartDate — 시작 날짜를 가져옵니다.
설명
객체 지향 스타일
public DatePeriod::getStartDate(): DateTimeInterface
기간의 시작 날짜를 가져옵니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
DatePeriod가 DateTimeImmutable 개체를 start
매개변수로 사용하여 초기화되면 DateTimeImmutable 개체를 반환합니다.
그렇지 않으면 DateTime 객체를 반환합니다.
Examples
예제 #1 DatePeriod::getStartDate() 예제
<?php
$period = new DatePeriod('R7/2016-05-16T00:00:00Z/P1D');
$start = $period->getStartDate();
echo $start->format(DateTime::ISO8601);
?>
위의 예는 다음을 출력합니다.
2016-05-16T00:00:00+0000
기타
- DatePeriod::getEndDate() - 종료 날짜를 가져옵니다.
- DatePeriod::getDateInterval() - 간격을 가져옵니다.