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.
精彩评论