php 指定时间加30分钟

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7080917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 01:58:16  来源:igfitidea点击:

Add 30 minutes in specified time

phptime

提问by Adnan Khan

Possible Duplicate:
PHP Date Time Current Time Add Minutes

可能重复:
PHP 日期时间当前时间添加分钟

I need to add 30 minutes in specified time, The below is result but how it will

我需要在指定的时间内添加 30 分钟,下面是结果,但它会如何

4:50 pm 30 minutes result= 5:20 pm

下午 4:50 30 分钟结果= 下午 5:20

4:50 pm is not current time 30 minutes need to add in specified time and the result is 5:20 pm

4:50 pm 不是当前时间 需要在指定时间加上 30 分钟,结果是 5:20 pm

回答by genesis

use strtotime

使用 strtotime

echo date('G:i:s', strtotime('NOW + 30 minutes'));

demo(GTM + 1)

演示(GTM + 1)

回答by Senad Me?kin

echo date('g:i a', time()+30*60);

this is for you.

这是给您的。