<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>比较两个日期的大小</title> </head> <body> <?php $time1 = strtotime(date( "Y-m-d H:i:s")); //当前的系统时间 $time3 = strtotime("2008-8-23 8:00:00"); //奥运会开幕时间 $sub2 = ceil(($time1 - $time3) / 86400); //(60秒 * 60分 * 24小时)秒/天 echo "北京奥运会已经结束<font color=red>$sub2 </font>天!!!"; ?> </body> </html>