将日期和时间转变成UNIX时间戳
//mktime(hour,minute,second,month,day,year);
echo date("M-d-Y",mktime(0,0,0,12,36,2007))."<br>";
echo date("m-d-y")."<br>";
日期计算
$_GET['date']='2007-3-8';
$birthday=strtotime($_GET['date']);
$nowtate=time();
$ageunix=$nowtate - $birthday;
$age=floor($ageunix/(60*60*24*365));
//echo "用户的在线年龄是:".$age."<br>";
echo $restime=$ageunix/(60*60*24*365)."<br>";
echo $month='0'.substr($restime,strpos($restime, '.'))."<br>";
echo "用户的在线年龄是:".$age.'年'.floor($month*12)."月<br>";