Adding 1 hour to time variable

后端 未结 10 1272
南笙
南笙 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 07:04

    try this it is worked for me.

    $time="10:09";
    $time = date('H:i', strtotime($time.'+1 hour'));
    echo $time;
    

提交回复
热议问题