Created
November 13, 2011 15:06
-
-
Save ptz0n/1362197 to your computer and use it in GitHub Desktop.
Seconds since midnight to date
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
<?php | |
/** | |
* Seconds since midnight to date | |
* | |
* @param string $date | |
* @param int $seconds | |
* | |
* @return string | |
*/ | |
function secondsSinceMidnightToDate($date, $seconds) | |
{ | |
return date('c', strtotime($date) + $seconds); | |
} | |
var_dump(secondsSinceMidnightToDate('2011-12-19', 80580)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: