Possible Duplicate:
Add 1 hour to datetime datatype
I have a timestamp stored in mysql db that I need to add 1 hour to before I display in our application (the timestamp is based on Central time, and I want to show Eastern). Quite simply I just need to add 1 hour to the value.
The stamp is stored as:
2012-02-12 05:20:03
Alternatively, once I retrieve it from the source, I could add an hour before storing it. I store it using the following foreach:
$created_at = strtotime($item->created_at);
Suggestions are greatly appreciated.
Instead of storing the formatted time, store the timestamp, either using the PHP time function or the mysql timestamp,
Then convert that back into a formatted time based on your needs using the php date function in this case or whatever other date formatting functions exist for other languages, except before you format the dates, add 3600 seconds/1 hr to them in order to achieve your objective.
Hope that helps.