php整理常用时间戳和日期

php整理常用时间戳和日期

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

淘建站为您提供更多_PHP功能模块_函数_日期_时间戳,在此特别感谢您对我们的支持与厚爱!

查看演示

演示不了,点击反馈

加入收藏

下载 140 次

下载资源

37 积分

特别说明:本站资源来自网友发布分享,仅供学习与参考,请勿用于商业用途,若有侵权请联系删除(272966172@qq.com)。

昨天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'));

声明:本资料由淘建站会员提供,如转载注明来源,资料来源淘建站免费素材库:https://www.taojz.cn/mokuai/180.html
php整理常用时间戳和日期 希望对你有帮助,感谢您的支持!
留言(0)
头像
 阿里云限量代金券,戳我领取
1 2