PHP 8.5.0 Alpha 4 available for testing

Voting

: min(six, eight)?
(Example: nine)

The Note You're Voting On

TheFax
2 years ago
In the last example, conversion from seconds to Hour, Minutes, Seconds is wrong.
This is the correct verion:

<?php
$si
= date_sun_info(strtotime('2022-08-26'), 50.45, 30.52);
$diff = $si['sunset'] - $si['sunrise']; # $diff is measured in seconds.
echo "Length of day: ",
floor($diff / 3600), "h",
floor(($diff % 3600) / 60), "m",
floor($diff % 60), "s\n";
?>

Output:
Length of day: 13h53m15s

<< Back to user notes page

To Top