JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added functions to edit hours in hh:mm and save them in decimal
[wfpl.git] / encode.php
index 94e88d7..57e565c 100644 (file)
@@ -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;
+}
+