Home > php教程 > php手册 > php中时间加减法

php中时间加减法

WBOY
Release: 2016-06-06 19:59:46
Original
1622 people have browsed it

//2014-07-15 加一天的日期 $tomorrow=date(’Y-m-d’,strtotime(2014-07-15 1day)); echo$tomorrow;//2014-07-16 $yestoday = date('Y-m-d',strtotime(2014-07-15 - 1day)); echo $yestoday; //2014-07-14 年、月、星期也可以加下试试

// 2014-07-15 加一天的日期    
$tomorrow = date(’Y-m-d’,strtotime("2014-07-15 + 1 day"));    

echo $tomorrow; // 2014-07-16  

$yestoday = date('Y-m-d',strtotime("2014-07-15 - 1day"));

echo $yestoday; //2014-07-14

年、月、星期也可以加下试试

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template