X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=time.php;h=a3bc76166ca21ea1190fc837bb74a13f28b2a1f8;hb=b7394a3a8379c423f6293fd343e6e4ef32d990ed;hp=81f4048e4daddfa5bb61db7ab196b89aa0da0f70;hpb=f48e1e60800ad1d4b740b15993bd779576ca5172;p=wfpl.git diff --git a/time.php b/time.php index 81f4048..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;