当前时间增加一天:
echo date('Y-m-d',strtotime("+1 day"))
当前时间增加一月:
echo date('Y-m-d',strtotime("+1 month"))
当前时间增加一年:
echo date('Y-m-d',strtotime("+1 year"))
当前时间增加一秒:
echo date('Y-m-d',strtotime("+1 seconds"))
上个月的天数
echo "上个月份天数:".date('t',strtotime('-1 month'));//上个月的天数
当前月份天数
echo "<br>当前月份天数:".date('t');//当前月份天数
已有时间增加一天:
$d='2020-11-22';//已有的时间 echo date('Y-m-d',strtotime("{$d} +1 day"));//在已有的时间上增加1天
更多的有
echo strtotime( 'yesterday ') echo date( "Ymd ",strtotime( 'last week '));