Add 30 seconds to the time with PHP

后端 未结 8 2062
旧时难觅i
旧时难觅i 2021-02-05 03:29

How can I add 30 seconds to this time?

$time = date(\"m/d/Y h:i:s a\", time());

I wasn\'t sure how to do it because it is showing lots of diffe

8条回答
  •  清歌不尽
    2021-02-05 03:49

    $time = date("m/d/Y h:i:s a", time() + 30);
    
    //or
    
    $time = date("m/d/Y h:i:s a", strtotime("+30 seconds"));
    

提交回复
热议问题