守着一只汪
我觉得strtotime就够用了吧?
抄段官网Demo:
<?php
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";
吐槽一句,函数太TM多了也不是什么好事情,有时候一个需求你知道文档里有,就是不知道在哪……