From: jason Date: Sat, 19 Apr 2008 03:19:13 +0000 (-0400) Subject: added enc_mmddyyyy() for text dates like 2008-05-22, fix name enc_ddmmyyyyhhmm()... X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=8331ba9439df4bdf02f35a988172f6869513b54f added enc_mmddyyyy() for text dates like 2008-05-22, fix name enc_ddmmyyyyhhmm() > enc_mmddyyyyhhmm() --- diff --git a/encode.php b/encode.php index b73a0ec..d37d1fa 100644 --- a/encode.php +++ b/encode.php @@ -125,7 +125,16 @@ function enc_upper($str) { return strtoupper($str); } -function enc_ddmmyyyyhhmm($seconds) { +# pass date in the form 2008-05-23 +# ercodes date as 05/23/2008 +function enc_mmddyyyy($yyyy_mm_dd) { + if(strlen($yyyy_mm_dd) != 10) { + return date('m/d/Y'); + } + return substr($yyyy_mm_dd, 5, 2) . '/' . substr($yyyy_mm_dd, 8, 2) . '/' . substr($yyyy_mm_dd, 0, 4); +} + +function enc_mmddyyyyhhmm($seconds) { return date('m/d/Y g:ia', (int)$seconds); } diff --git a/metaform/template.html b/metaform/template.html index 2a359d3..b739c41 100644 --- a/metaform/template.html +++ b/metaform/template.html @@ -49,7 +49,7 @@
- +
~caption.html~: ~caption.html~: ~caption.html~: dd/mm/yy~caption.html~: ~caption.html~: ~caption.html~:
~caption.html~: ~caption.html~: ~caption.html~: ~caption.html~? ~caption.html~?
~caption.html~: ~caption.html~: ~caption.html~: dd/mm/yy~caption.html~: ~caption.html~: ~caption.html~:
~caption.html~: ~caption.html~: ~caption.html~: ~caption.html~? ~caption.html~?