strtotime

  • 直接看代码吧:

        echo date('Y-m-d',strtotime('-1 month',strtotime('2019-03-31'))),PHP_EOL;\
        //outputs: 2019-03-03\
        echo date('Y-m-d',strtotime('last day of last month',strtotime('2019-03-31'))),PHP_EOL;\
        //outputs: 2019-02-28
    
  • 鸟哥写的文章:令人疑惑的 strtotime

本作品采用《CC 协议》,转载必须注明作者和本文链接