php中挺好用的strtotime方法
在PHP中,经常要对日期进行计算,比如要计算一个月前的日期,那么其实最快的方法
是用strtotime,其功能很丰富,如下:
echo strtotime("now"), "\n"; echo strtotime("10 September 2000"), "\n"; echo strtotime("+1 day"), "\n"; echo strtotime("+1 week"), "\n"; echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n"; echo strtotime("next Thursday"), "\n"; echo strtotime("last Monday"), "\n";