码迷,mamicode.com
首页 > Web开发 > 详细

PHP获取今天开始和结束的时间戳

时间:2016-04-06 15:02:08      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:

$t = time();
$start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$t));
$end = mktime(23,59,59,date("m",$t),date("d",$t),date("Y",$t));

echo "一周后:".date("Y-m-d",strtotime("+1 week")). "
";     
echo "一周零两天四小时两秒后:".date("Y-m-d G:H:s",strtotime("+1 week 2 days 4 hours 2 seconds")). "
";     
echo "下个星期四:".date("Y-m-d",strtotime("next Thursday")). "
";     
echo "上个周一:".date("Y-m-d",strtotime("last Monday"))."
";     
echo "一个月前:".date("Y-m-d",strtotime("last month"))."
";     
echo "一个月后:".date("Y-m-d",strtotime("+1 month"))."
";     
echo "十年后:".date("Y-m-d",strtotime("+10 year"))."
";    

PHP获取今天开始和结束的时间戳

标签:

原文地址:http://www.cnblogs.com/xieqian111/p/5359125.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!