X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=time.php;h=a3bc76166ca21ea1190fc837bb74a13f28b2a1f8;hb=73490300ca9dea6fc3c6d3a474ab49796fd58438;hp=b9181b01a6cec4d6b01ba8f73fcb0b2f384d99c9;hpb=1442d052713fdb380810692bbe1ddee5306b5a7a;p=wfpl.git diff --git a/time.php b/time.php index b9181b0..a3bc761 100644 --- a/time.php +++ b/time.php @@ -81,7 +81,11 @@ function mdy_to_ymd($date) { switch(count($parts)) { case 1: $year = $parts[0]; - list($month, $day) = explode('/', date('m/d')); + if(strlen($year) == 0) { + list($month, $day, $year) = explode('/', date('m/d/Y')); + } else { + list($month, $day) = explode('/', date('m/d')); + } break; case 2: list($month, $year) = $parts; @@ -104,7 +108,11 @@ function ymd_to_mdy($date) { switch(count($parts)) { case 1: $year = $parts[0]; - list($month, $day) = explode('-', date('m-d')); + if(strlen($year) == 0) { + list($year, $month, $day) = explode('-', date('Y-m-d')); + } else { + list($month, $day) = explode('-', date('m-d')); + } break; case 2: list($year, $month) = $parts; @@ -119,4 +127,8 @@ function ymd_to_mdy($date) { return sprintf('%02u/%02u/%04u', $month, $day, $year); } +function enc_mdy($date) { + return ymd_to_mdy($date); +} + ?>