<?php // 设置时区 date_default_timezone_set('PRC'); $time = strtotime('-3 day'); var_dump($time); echo date('Y-m-d H:i:s',$time); echo "<hr>"; //strtotime() 函数将任何英文文本的日期或时间描述解析为 Unix 时间戳 echo date('Y-m-d H:i:s',strtotime('last moday')); echo "<hr>"; echo date('Y-m-d H:i:s',strtotime('+3 day')); echo "<hr>"; echo date('Y-m-d H:i:s',strtotime('-1 week')); echo "<hr>"; echo date('Y-m-d H:i:s',strtotime('last years')); echo "<hr>"; echo date('Y-m-d H:i:s',strtotime('next friday')); echo "<hr>"; ?> |
|