Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
added functions to edit hours in hh:mm and save them in decimal
[wfpl.git]
/
encode.php
diff --git
a/encode.php
b/encode.php
index
94e88d7
..
57e565c
100644
(file)
--- 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;
+}
+