Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. function HHMMSStoSeconds($time) {
  4. return strtotime("1970-01-01 $time UTC");
  5. }
  6.  
  7. function secondsToHHMMSS($seconds) {
  8. return sprintf("%02d%s%02d%s%02d", floor($seconds / 3600), ':', ($seconds / 60) % 60, ':', $seconds % 60);
  9. }
  10.  
  11. // Time to decimal converter
  12. function timeToDecimal($time) {
  13. $timeArr = explode(':', $time);
  14. $decTime = ($timeArr[0] * 60) + ($timeArr[1]) + ($timeArr[2] / 60);
  15. return $decTime;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement