添加当天的日期 [英] add day to current date
本文介绍了添加当天的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
添加一个日期,所以我可以将明天的日期存储在变量中。
add a day to date, so I can store tomorrow's date in a variable.
$tomorrow = date("Y-m-d")+86400;
我忘了。
推荐答案
date
返回一个字符串,而你想要添加86400秒的时间戳。我想你正在寻找:
date
returns a string, whereas you want to be adding 86400 seconds to the timestamp. I think you're looking for this:
$tomorrow = date("Y-m-d", time() + 86400);
这篇关于添加当天的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文