Timezones in WordPress and MySql
-
I’ve got a custom table and am storing everything in UTC time for various reasons.
I want to use the mysql CONVERT_TZ function to convert to the blog timezone. Using get_option(‘gmt_offset’) I can get the blog time offset, however this is in a different format to MySQL.
get_option(‘gmt_offset’) returns values like ‘0’, ‘-0.5’, etc.
MySql expects values like ‘+00:00’, ‘-00:30’Is there an easy way to convert from the one style to the other that anyone has used? Or is there some other way around that I should be looking at this?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Timezones in WordPress and MySql’ is closed to new replies.