Home > Backend Development > PHP Tutorial > php?计算结束时间

php?计算结束时间

WBOY
Release: 2016-06-20 12:49:27
Original
847 people have browsed it

<?php$StartDate=2015-07-17$day=20$EndDate=2015-08- 06       //平年和闰年  ,大月和小月//如何计算出这个结果???>
Copy after login


回复讨论(解决方案)

date函数就可以了啊

echo date('Y-m-d', strtotime('+20 day 2015-07-17'));

<?php$StartDate='2015-07-17';$StartTime = strtotime($StartDate);$day=20;$EndDate=date('Y-m-d', $StartTime + 20*24*3600); echo $EndDate;?>
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