$date1=time()可以获取当前时间的时间戳。接下来用date()函数将其转化成不同的时间。
$date2=date('Y-m-d H:i:s',$date1);
$year=((int)substr("2008-12-04",0,4));//取得年份
$month=((int)substr("2008-12-04",5,2));//取得月份
$day=((int)substr("2008-12-04",8,2));//取得几号
echo mktime(0,0,0,$month,$day,$year);
php的date()函数参数很多,需要查看使用手册了!