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
Add 30 minutes in specified time
提问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
回答by Senad Me?kin
echo date('g:i a', time()+30*60);
this is for you.
这是给您的。
回答by bhamby
Here's an article that shows some date math examples. You might also find the PHP Time Manualuseful.
这是一篇展示一些日期数学示例的文章。您可能还会发现PHP 时间手册很有用。