PHP, Get tomorrows date from date

后端 未结 11 1866
不思量自难忘°
不思量自难忘° 2020-11-30 02:54

I have a PHP date in the form of 2013-01-22 and I want to get tomorrows date in the same format, so for example 2013-01-23.

How is this pos

11条回答
  •  悲&欢浪女
    2020-11-30 03:26

    Since you tagged this with strtotime, you can use it with the +1 day modifier like so:

    $tomorrow_timestamp = strtotime('+1 day', strtotime('2013-01-22'));
    

    That said, it's a much better solution to use DateTime.

提交回复
热议问题