PHP date_sun_info() 함수
예시
위도 31.7667, 경도 35.2333에 대해 2013년 1월 1일의 일몰/일출 및 황혼 시작/종료에 대한 정보를 반환합니다.
<?php
$sun_info=date_sun_info(strtotime("2013-01-01"),31.7667,35.2333);
foreach ($sun_info as $key=>$val)
{
echo "$key: " . date("H:i:s",$val) . "<br>";
}
?>
정의 및 사용
date_sun_info() 함수는 지정된 날짜와 위치에 대한 일몰/일출 및 황혼 시작/종료에 대한 정보가 포함된 배열을 반환합니다.
팁: date_sunrise() 함수를 살펴보고 지정된 날짜와 위치의 일출 시간을 반환합니다.
팁: date_sunset() 함수를 살펴보고 지정된 날짜와 위치의 일몰 시간을 반환합니다.
통사론
date_sun_info(timestamp, latitude, longitude)
매개변수 값
Parameter | Description |
---|---|
timestamp | Required. Specifies a timestamp |
latitude | Required. Specifies the latitude in degrees |
longitude | Required. Specifies the longitude in degrees |
기술적 세부 사항
반환 값: | 성공 시 배열을 반환합니다. 실패시 FALSE |
---|---|
PHP 버전: | 5.1.2+ |
❮ PHP 날짜/시간 참조