I'm working on a blog migration from a custom built blog to Wordpress. One of the fields that Wordpress is looking for in the database is a date/time stamp set to GMT, which is 4 hours ahead of our time. So I basically need to take our date/time stamp (in YYYY-MM-DD HH:MM:SS format), and add four hours to it. I was looking at the MySQL command "ADDTIME", but I think that only works on selects, not on inserts.
I had worked up a script that exploded the date in to parts, and added 4 hours to the time, but the ensuing logic that would be required to check for when 4 hours pushes in to the next day/month/year seemed a little excessive.
- asked 4 years ago
- Gul Hafiz