Source Code:
(back to article)
<?php $date = "2023-03-03"; $timestamp = strtotime($date); $latitude = 40.7128; // New York City latitude $longitude = -74.0060; // New York City longitude $zenith = ini_get("date.sunrise_zenith"); $sunrise_time = date_sunrise($timestamp, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith); echo "The sunrise time for New York City on $date is $sunrise_time."; ?>
Result:
Report an issue