开发者

Decrease 5 days from a date [duplicate]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜