O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

date_sunrise

Synopsis

mixed date_sunrise(int timestamp[, int format[, float latitude[, float longitude
    [, float zenith[, float gmt_offset]]]]])

Returns the time of the sunrise for the day in timestamp; false on failure. The format parameter determines the format the time is returned as (with a default of SUNFUNCS_RET_STRING), while the latitude, longitude, zenith, and gmt_offset parameters provide a specific location. They default to values given in the PHP configuration options (php.ini). Parameters include:

SUNFUNCS_RET_STRING

Returns the value as a string; for example, “06:14”

SUNFUNCS_RET_DOUBLE

Returns the value as a float; for example, 6.233

SUNFUNCS_RET_TIMESTAMP

Returns the value as a Unix epochal timestamp

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required