Adding 1 hour to time variable

后端 未结 10 1260
南笙
南笙 2020-12-05 06:27

I have a time to which I want to add an hour:

$time = \'10:09\';

I\'ve tried:

$time = strtotime(\'+1 hour\');

strtotime(\'+1          


        
10条回答
  •  伪装坚强ぢ
    2020-12-05 06:54

    You can do like this

        echo date('Y-m-d H:i:s', strtotime('4 minute'));
        echo date('Y-m-d H:i:s', strtotime('6 hour'));
        echo date('Y-m-d H:i:s', strtotime('2 day'));
    

提交回复
热议问题