X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=encode.php;h=57e565ce5d4058cb109b4458771d65c05300af21;hb=7dcbcb707e35c41d11266db7243416f86686dd79;hp=94e88d7237a08a367cece6499020563e9b829cd3;hpb=c84327eb5f13ebd2af0792adbdfb35cfb1a3eca5;p=wfpl.git diff --git a/encode.php b/encode.php index 94e88d7..57e565c 100644 --- a/encode.php +++ b/encode.php @@ -165,6 +165,15 @@ function enc_mmddyyyyhhmm($seconds) { return date('m/d/Y g:ia', (int)$seconds); } +# takes decimal +# returns hh:mm +function enc_hhmm($str) { + $hours = floor($str); + $minutes = round(($str - $hours) * 60); + $str = sprintf("%d:%02d", $hours, $minutes); + return $str; +} +