首页 > Web开发 > 详细

php面试题

时间:2015-08-26 23:51:02      阅读:368      评论:0      收藏:0      [点我收藏+]

1.用PHP打印出前一天的时间格式是2006-5-10 22:21:21(2分)

<?php
date_default_timezone_set(‘Asia/shanghai‘); 
echo date_default_timezone_get();
echo "<br/>"; 
echo @date("Y-m-d H:i:s",strtotime("-1 day"));
echo(strtotime("now")); //当前时间戳
echo(strtotime("+5 hours",strtotime("1970-01-01"))); //距离1970-01-01后5个小时的时间戳 echo(strtotime("3 October 2005"));//2005年10月3日时间戳 echo(strtotime("+5 hours")); //当前时间加5个小时的时间戳 echo(strtotime("+1 week")); //当前时间加一周的时间戳 echo(strtotime("+1 week 3 days 7 hours 5 seconds")); //当前时间加一周3天7小时5秒钟的时间戳 echo(strtotime("next Monday")); //当前时间到下个周一0点的时间戳 echo(strtotime("last Sunday")); //上个周日凌晨到当前时间的时间戳 ?>

2.

php面试题

原文:http://www.cnblogs.com/xiaoyueer/p/4761920.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!