PHP date_isodate_set() 함수
예시
ISO 날짜를 2013년의 5번째 주로 설정합니다.
<?php
$date=date_create();
date_isodate_set($date,2013,5);
echo date_format($date,"Y-m-d");
?>
정의 및 사용
date_isodate_set() 함수는 특정 날짜를 사용하는 대신 주와 일 오프셋을 사용하여 ISO 8601 표준에 따라 날짜를 설정합니다.
통사론
date_isodate_set(object, year, week, day)
매개변수 값
Parameter | Description |
---|---|
object | Required. Specifies a DateTime object returned by date_create() |
year | Required. Specifies the year of the date |
week | Required. Specifies the week of the date |
day | Optional. Specifies the offset from the first day of the week. Default is 1 |
기술적 세부 사항
반환 값: | 성공하면 DateTime 객체를 반환합니다. 실패시 FALSE |
---|---|
PHP 버전: | 5.2+ |
PHP 변경 로그: | PHP 5.3: 반환 값이 NULL에서 DateTime으로 변경됨 |
❮ PHP 날짜/시간 참조