<?php
TIME_THIS_WEEK;
echo strtotime("last Monday"); #2017/1/2 0:0:0
TIME_THIS_MONTH;
echo strtotime(date("Y-m-1")); #2017/1/1 0:0:0
TIME_LAST_MONTH;
$last_month_time = strtotime("last Month");
echo strtotime(date("Y-m-1", $last_month_time)); #2016/12/1 0:0:0
echo strtotime(date("Y-m-1")); #REPEAT #2017/1/1 0:0:0
本文介绍了使用PHP获取特定日期的时间戳方法,包括本周初、本月初及上个月初的时间戳,通过实例展示了如何利用PHP内置函数实现这些日期操作。
676

被折叠的 条评论
为什么被折叠?



