From 4eb7802495423bf2fac8999652a5a24aa4626770 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Fri, 12 Oct 2007 05:35:26 -0400 Subject: [PATCH] made date conversion programs default to the current year (not 2000) --- time.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; -- 1.7.10.4