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

Laravel时间函数问题

WBOY
Release: 2016-06-06 20:11:10
Original
1226 people have browsed it

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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template