PHP: date_sun_info - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

date_sunrise date_parse

Last updated: Sat, 27 Jan 2007

view this page in

# date_sun_info

(no version information, might be only in CVS)

date_sun_info -- Returns an array with information about sunset/sunrise and twilight begin/end

## Описание

array date_sun_info ( int time, float latitude, float longitude )

## Список параметров

`time`

  Timestamp.

`latitude`

  Latitude in degrees.

`longitude`

  Longitude in degrees.

## Возвращаемые значения

Returns array on success or `FALSE` on failure.

## Примеры

Пример 1. A date_sun_info() example

`<?php
$sun_info = date_sun_info(strtotime("2006-12-12"), 31.7667, 35.2333);
foreach ($sun_info as $key => $val) {
echo "$key: " . date("H:i:s", $val) . "\n";
}
?>`

Результат выполнения данного примера:

    sunrise: 05:52:11
    sunset: 15:41:21
    transit: 10:46:46
    civil_twilight_begin: 05:24:08
    civil_twilight_end: 16:09:24
    nautical_twilight_begin: 04:52:25
    nautical_twilight_end: 16:41:06
    astronomical_twilight_begin: 04:21:32
    astronomical_twilight_end: 17:12:00

add a note User Contributed Notes
date_sun_info
Dan
07-Mar-2007 11:08
`The description appears to have lat and lon reversed. I was able to get successful results using:
array date_sun_info (int $time, float $longitude, float $latitude)`
add a note
date_sunrise date_parse

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST