开发者

mysql & php: adding time or day to the created/ updated time in the database

开发者 https://www.devze.com 2023-01-28 03:40 出处:网络
This is the time formate I store in my mysql database for each item of a data injection, for instance,

This is the time formate I store in my mysql database for each item of a data injection, for instance,

2010-12-04 16:00:09

I will output the time like this

echo $item['item_updated'];

but I want to add 24 hours or 48 hours or maybe a week of hours to this time output - how can I do t开发者_开发问答hat?

the result will be like, for instance,

2010-12-05 10:00:09 // due to 2010-12-04 16:00:09 + 24 hours

thanks.


Consider using PHP DateTime Object and it's relevant member method.

0

精彩评论

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