开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜