Display the text box

date_sunset()

« date_sunrise | DateTime::add »
<?php
// select a $timezone or enter $gmt_offset
// enter a $time or a $timestamp
// select a $city or enter the $latitude and $longitude

// gets a timestamp from a date
date_default_timezone_set(
    
? // string $timezone
);
$timestamp strtotime(
    
 // string $time
);

// gets the latitude and longitude of a city
list($latitude$longitude) = pbx_get_city_lat_lng(
    
? // string $city
);

$mixed date_sunset (
    
// int $timestamp
    
?// [int $format = SUNFUNCS_RET_STRING]
    
// [float $latitude = ini_get("date.default_latitude")]
    
// [float $longitude = ini_get("date.default_longitude")]
    
?// [float $zenith = ini_get("date.sunset_zenith")]
    
?  // [float $gmt_offset = 0]
);
?>
Result
$timestamp = 1711677045
$latitude = 48.85
$longitude = 2.35
$mixed = '19:17'
Examples
#1 date_sunset  (/* $timezone = "Europe/Paris" */
 /* $time = "now" */
 /* $city = "Paris" */
 
$timestamp,
 
SUNFUNCS_RET_STRING,
 
$latitude,
 
$longitude)
#2 date_sunset  (/* $time = "2014-12-20 12:00" */
 
$timestamp,
 
SUNFUNCS_RET_STRING,
 
38.72,
 -
9.13,
 
90,
 
1)
See also
date_default_timezone_set, date_sunrise, pbx_get_city_lat_lng, strtotime