代码如下:
$date=date("Y-m-d",strtotime("2011-12-12"));
第二种方式
$date="2011-12-12";
$year=((int)substr($date,0,4));//取得年份
$month=((int)substr($date,5,2));//取得月份
$day=((int)substr($date,8,2));//取得几号
$_date=date("M-d-Y",mktime(0,0,0,$month,$day,$year));