zoukankan      html  css  js  c++  java
  • strtotime

    echo date("Y-m-d",strtotime("-1 month",strtotime("2019-7-31")));
    //2017-07-01
    //为什么输出不是6.31呢,因为6月没有31,-1 month变成6.31后其实是7.1号。
    
    echo date("Y-m-d",strtotime("last day of -1 month",strtotime("2019-7-31"))); //2017-06-30
    echo date("Y-m-d",strtotime("first day of -1 month",strtotime("2019-7-31"))); //2017-06-01
    

      

  • 相关阅读:
    4-11
    4-10
    4-9
    4-7
    4-8
    4-6
    4-4
    4-5
    4-3
    4-2
  • 原文地址:https://www.cnblogs.com/xin-jun/p/10825182.html
Copyright © 2011-2022 走看看