Home >Backend Development >PHP Tutorial >Laravel时间函数问题

Laravel时间函数问题

WBOY
WBOYOriginal
2016-06-06 20:11:101221browse

Laravel时间函数问题,
比如现在的时间是:2016-04-21 14:53:20
我想显示30天后的那一天的最后一秒,就是2016-05-21 23:59:59
应该怎么做呢?

回复内容:

Laravel时间函数问题,
比如现在的时间是:2016-04-21 14:53:20
我想显示30天后的那一天的最后一秒,就是2016-05-21 23:59:59
应该怎么做呢?

<code class="PHP">$time = strtotime('2016-04-21 14:53:20');
echo date('Y-m-d 23:59:59',strtotime('+1 month',$time));</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn