Adding 1 hour to time variable

后端 未结 10 1256
南笙
南笙 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:50

    for this problem please follow bellow code:

    $time= '10:09';
    $new_time=date('H:i',strtotime($time.'+ 1 hour'));
    echo $new_time;`
    // now output will be: 11:09
    

提交回复
热议问题