Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function HHMMSStoSeconds($time) {
- return strtotime("1970-01-01 $time UTC");
- }
- function secondsToHHMMSS($seconds) {
- return sprintf("%02d%s%02d%s%02d", floor($seconds / 3600), ':', ($seconds / 60) % 60, ':', $seconds % 60);
- }
- // Time to decimal converter
- function timeToDecimal($time) {
- $timeArr = explode(':', $time);
- $decTime = ($timeArr[0] * 60) + ($timeArr[1]) + ($timeArr[2] / 60);
- return $decTime;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement