PHP Date Time Current Time Add Minutes

前端 未结 12 2171
忘掉有多难
忘掉有多难 2020-12-01 07:21

Simple question but this is killing my time.

Any simple solution to add 30 minutes to current time in php with GMT+8?

12条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 07:52

    $timeIn30Minutes = mktime(idate("H"), idate("i") + 30);
    

    or

    $timeIn30Minutes = time() + 30*60; // 30 minutes * 60 seconds/minute
    

    The result will be a UNIX timestamp of the current time plus 30 minutes.

提交回复
热议问题