X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=encode.php;h=d37d1fa561b137e842093357f9484769a5d124c8;hb=8331ba9439df4bdf02f35a988172f6869513b54f;hp=b73a0ecb430fb9f5577b5dabd66859c0bff2cc89;hpb=68b54762b87a203466072ce56911040520de26d1;p=wfpl.git 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); }