Are timezones supported in MySqL ?
Category: Server Usage
I am trying to use the CONVERT_TZ functiuon
SELECT CONVERT_TZ( '2005-01-27 13:30:00', 'UTC', 'UTC' )
(just an example)
But always getting a NULL answer...
SELECT CONVERT_TZ( '2005-01-27 13:30:00', 'UTC', 'UTC' )
(just an example)
But always getting a NULL answer...
OTHER ANSWERS
|
0
|
Hi limeyx, Thanks for posting your question. I'm more than happy to assist you today. While timezones are available in MySQL you do not have access to the server's timezones table. Therefore, any SQL statement you write with the timeszones in it will return a NULL value. I've created a workaround for this: SELECT CONVERT_TZ( '2005-01-27 13:30:00', '+00:00','+01:00' ) This uses the actual offsets to convert the value. You'll have to manually count the offset in time and replace the '+01:00' in the code snippet. The first set '+00:00' says it's a default or base time. If you run the command from above, it will offset the time by adding one hour to it. I hope this helps! If you need further assistance please feel free to contact us. Thanks! Tim S |
Like this Question?
Tweet
Latest Questions
If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Recent QuestionsNeed more Help?
Search
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |


