← All docs

date_sunset()

Returns the sunset time for a day and location. Deprecated since PHP 8.1.

date_sunset()

function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null): mixed

Returns the sunset time for a day and location. Deprecated since PHP 8.1.

Parameters:

  • $timestamp (int)
  • $returnFormat (int), default SUNFUNCS_RET_STRING, optional
  • $latitude (?float), default null, optional
  • $longitude (?float), default null, optional
  • $zenith (?float), default null, optional
  • $utcOffset (?float), default null, optional

Returns: mixed

Availability

  • Compiled (AOT): supported through the Elephc compiler.
  • eval() (magician interpreter): supported through the procedural date/time alias dispatcher.

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how date_sunset is implemented in the compiler, see the internals page.