Advertisement
AMONRA75

PHP - DATETIME TO SECONDS

Apr 8th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. function secondsToTime($seconds) {
  2. $dtF = new \DateTime('@0');
  3. $dtT = new \DateTime("@$seconds");
  4. return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
  5. }
  6.  
  7. function secondsToTime($seconds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement