search

Home  >  Q&A  >  body text

strtotime problem

date('Y-m-d H:i:s',strtotime(' 1 month',strtotime('2018-12-01')-1));

Why does it come out as 12 Month 30, 23:59:59

宋YM宋YM2162 days ago814

reply all(2)I'll reply

  • 韦小宝

    韦小宝2019-01-02 10:44:33

    First of all, you have to know what the strtotime function means. The strtotime function parses time into a Unix timestamp. After conversion, you finally have another one minus one, which is of course yesterday's time

    reply
    0
  • Cancelreply