Reputation: 640
Now I have wrong timezone set on my server, so all the records in my MySQL database have timestamps different from the real by 4 hours. How do I update all the timestamps to match the real time?
For example, I have timestamp like 2014-06-28 20:34:29
. I need it to become 2014-06-29 00:34:29
.
Any help would be appreciated.
Upvotes: 1
Views: 919
Reputation: 345
assuming your date field is named created_at
update <table> SET created_at = DATE_ADD(created_at,INTERVAL 4 HOUR)
Upvotes: 3