最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

php整理常用时间戳和日期

来源:http://www.erdangjiade.com/ 沐浴春风 2015-06-12 07:04浏览(1742)

本文整理了常用的时间戳,你也可以用date日期函数转换成日期。

0、请不要问“在不在”之类的问题,有问题直接问!1、学生或暂时没有工作的童鞋,整站资源免费下载!2、¥9.9充值终身VIP会员,加我微信,826096331 拉你进VIP群学习!3、程序员加油,技术改变世界。 在线 充值

分类:日期时间 > 时间戳 难易:入门级
查看演示 下载资源:

加我微信,拉你进VIP群学习:

下载资源 下载积分: 30 积分

昨天0时时间戳

$yesterday_zero = strtotime(date('Y-m-d')) - 3600 * 24;

昨天此时时间戳

$yesterday_now = strtotime('-1 day');

本周一时间戳

$week_this_monday = strtotime('last Monday');

明天时间戳

$tomorrow = strtotime("+1 day");

上周一时间戳

$week_last_monday = strtotime('last Monday') - 3600 * 24 * 7;

上周日时间戳

$week_last_sunday = strtotime('last Monday') - 3600 * 24;

本月第一天时间戳

$month_first = strtotime(date("Y") . "-" . date("m") . "-1");

本月最后一天时间戳

$month_last = strtotime(date("Y") . "-" . date("m") . "-" . date("t"));

获取上个月第一天及最后一天

echo date('Y-m-01', strtotime('-1 month'));
echo "<br/>";
echo date('Y-m-t', strtotime('-1 month'));
标签: 日期时间戳
声明:本文为原创文章,如需转载,请注明来源erdangjiade.com并保留原文链接:https://www.erdangjiade.com/php/180.html
评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2