Version difference for strtotime('first day of last month')?

后端 未结 4 924
一生所求
一生所求 2021-01-02 07:55

In a script that contains

date(\'Y-m-d\', strtotime(\'first day of last month\'))

in version 5.3.10 (localhost) I get, for example, \'2012

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 08:37

    As simple as:

    date('Y-m-01')
    

    The first day of any month always is 1.

提交回复
热议问题