有一段时间,我怎么能找到一个月前的时间

ste*_*ven 5 php time date

有一段时间,我怎么能找到一个月前的时间.

Gal*_*len 16

strtotime( '-1 month', $timestamp );
Run Code Online (Sandbox Code Playgroud)

http://php.net/manual/en/function.strtotime.php

  • 注意:这将在31天月和3月底导致意外结果.http://derickrethans.nl/obtaining-the-next-month-in-php.html (3认同)