文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>距离某天的时间(php实现)

距离某天的时间(php实现)

时间:2011-04-26  来源:木由水

$date1 = strtotime('2011-04-30');  //把日期转换成时间戳
$date2 = time(); //取当前时间的时间戳

$nowtime=strftime("%y年-%m月-%d日 ",$date2); //格式化输出日期

$days=round(($date1-$date2)/3600/24); //四舍五入

echo "今天是<font color=\"red\">".$nowtime."</font>";
echo "<br/>距".strftime("%y年-%m月-%d日 ",$date1)."还有<font colr=\"red\">".$days."</font>天";

相关阅读 更多 +
排行榜 更多 +
僵尸运行3d城市逃生

僵尸运行3d城市逃生

冒险解谜 下载
顶尖猎人罗迪和凯茜

顶尖猎人罗迪和凯茜

冒险解谜 下载
火柴人飞爪忍者

火柴人飞爪忍者

冒险解谜 下载