//时间戳是1970年1月1日到现在的秒数! //date函数 //当前时间.
date_default_timezone_set("PRC"); echo date("Y-m-d h:i:s");//2014-03-08 echo "<br>"; echo time("Y-m-d");//1394300809time()函数将给当前时间显示成时间戳格式 echo "<br>"; echo date(‘Y-m-d h:i:s‘,"1394300809");//将时间戳转换为时间格式。 //显示明天、明天、下周、下个月的时间 echo "<br>"; echo date(‘Y-m-d‘,strtotime(‘-1 day‘));//昨天 echo "<br>"; echo date(‘Y-m-d‘,strtotime(‘+1 day‘));//明天 echo "<br>"; echo date(‘Y-m-d‘,strtotime(‘+1 week‘));//下周的今天 echo "<br>"; echo date(‘Y-m-d‘,strtotime(‘+1 month‘));//下个月。
原文:http://www.cnblogs.com/tudoudaqiang/p/3599865.html