strtotime use

WBOY
Release: 2016-08-08 09:27:24
Original
1088 people have browsed it
获取当前时间或者任一时间加上任一天数 并转换成日期格式
1、
$date = date('Y-m-d H:i:s',strtotime('+4 days));
//说明:strtotime 的第二个参数为空,默认取值 time();
2、
$time = strtotime(date('2015-03-01 H:i:s));//指定任一时间并转换成时间戳

$date= date("Y-m-d H:i:s", strtotime("+5 days", $time));//在指定时间加上任意天数并转换成日期格式
Copy after login

The above introduces the use of strtotime, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.

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