如何从数据库中存储的日期开始一周? [英] How do I get a week in the future from the date stored in the database?
本文介绍了如何从数据库中存储的日期开始一周?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前我有一个数据库可以自动设置创建行的日期和时间。
我希望能够显示该日期,但未来一周。
这可能吗?我看过其他地方,但似乎没有任何意义。我可以使用带变量的strtotime吗?我试过这个:
Hi,
Currently I have a database that automatically sets the date and time when the row is created.
I want to be able to display that date, but 1 week in the future.
Is this possible? I've looked elsewhere but nothing seems to make sense. Can I use strtotime with a variable? I've tried this:
$dateCreated = $row['dateCreated'];
$futureTime = strtotime($dateCreated, '+1 Week'));
echo $futureTime;
但是这段代码没有回应任何东西。
However this code does not echo anything.
推荐答案
dateCreated =
dateCreated =
row [' dateCreated'];
row['dateCreated'];
futureTime = strtotime(
futureTime = strtotime(
这篇关于如何从数据库中存储的日期开始一周?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文