Change 1 Jan 2010 farmat to 1-1-2010

Any one plz suggest somecode to convert 1 Jan 2010 farmat to 1-1-2010. I have used below code . But while running i am getting the error :

Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\Inetp…


$d1=$_POST['d1'];//1 Jan 2010
list($dd1,$mm1,$yy1)=split(' ',$d1);
$d1=$yy1.'-'.date("m", strtotime($mm1)).'-'.$dd1;


$date = "1 Jan 2010";

$monNum = array('Jan' => '1');

list($d, $m, $y) = explode(' ', $date);

echo $d . '-' . $monNum[$m] . '-' . $y;

strtotime($mm1)

that means strtotime(‘Jan’), which obviously won’t work.
try date(‘d-m-Y’, strtotime($d1));

agree!

thank you guys… now it works fine