开发者

Decrease 5 days from a date [duplicate]

开发者 https://www.devze.com 2023-02-20 00:32 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Subtracting a certain number of hours, days, months or years from date 开发者_如何转开发
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Subtracting a certain number of hours, days, months or years from date 开发者_如何转开发

Hello, how can I decrease 5 days from a date like:

date("d.m.y");

-Thanks


date('d.m.y', strtotime('-5 days'));


date("d.m.y",mktime(0,0,0,date("m"),date("d")-5,date("Y")))


Avoid strtotime when possible, it is slow

date('d.m.y',time() - 432000); // 60 * 60 * 24 * 5
0

精彩评论

暂无评论...
验证码 换一张
取 消