PHP Function Reference

PHP Date/Time - Runtime Configuration



The behavior of date/time functions is affected by settings in php.ini.

Date/Time Configuration Options

NameDefaultChangeable
date.default_latitude"31.7667"PHP_INI_ALL
date.default_longitude"35.2333"PHP_INI_ALL
date.sunrise_zenith"90.583333"PHP_INI_ALL
date.sunset_zenith"90.583333"PHP_INI_ALL
date.timezone""PHP_INI_ALL

The short explanation of the configuration directives are given below:

NameTypeDescription
date.default_latitudefloatThe default latitude ranging from 0 at the equator, to +90 northward, and -90 southward.
date.default_longitudefloatThe default longitude ranging from 0 at the prime meridian to +180 eastward and −180 westward.
date.sunrise_zenithfloatThe default sunrise zenith.
date.sunset_zenithfloatThe default sunset zenith.
date.timezonestringThe default timezone used by all date/time functions. The precedence order for which timezone is used if none is explicitly mentioned is described in the date_default_timezone_get() function. See List of Supported Timezones for a list of supported timezones.

Note: The first four configuration options are currently only used by date_sunrise() and date_sunset().

❮ PHP Date and Time Reference