日期与时间戳的获取
获取当前时间: time()
获取当前时间戳:date(“Y/m/d H:i:s”)
echo time(); //1584948914
echo date("Y/m/d H:i:s"); //2020-03-23 15:35:14
日期与时间戳的转换
日期转换时间戳:strtotime(date(“Y/m/d”))
时间戳转换日期:echo date(‘Y-m-d’,time())
echo strtotime(date("Y/m/d")); //1584948914
echo echo date('Y-m-d',time()); //2020-03-23 15:35:14
strtotime的用法
一天后此时的时间戳: strtotime("+1 day");
一周后此时的时间戳: strtotime("+1 week");
一年后此时的时间戳: strtotime("+1 year");
下周四的日期: date(“Y-m-d H:i:s”,strtotime(“next Thursday”));
上周四的日期:date(“Y-m-d H:i:s”,strtotime(“last Thursday”));