Created
February 25, 2023 12:36
-
-
Save joanfabregat/f01173617486165013a969ef584c7d14 to your computer and use it in GitHub Desktop.
Heures et minutes en PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getHoursAndMinutes(int $seconds): string | |
{ | |
return sprintf( | |
"%dh%02d", | |
(int)floor($seconds / 3600), | |
($seconds / 60) % 60 | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment