The time zone name of the MySQL server you are connected to takes one line to read. MySQL developers and DBAs regularly need the time zone of the session they are connected to. The MySQL documentation and search engines give many ways to do it. In this post, I show the simple method I use.

The Query
Run the following script against your MySQL server:
SELECT @@system_time_zone;The Result
It returns a result set with the name of your time zone. I am in India, and my machine’s time zone is India Standard Time. So the result contains the same.

Your Turn
Let me know if you use another method to retrieve the time zone of the server where MySQL is installed.

A time zone is not a setting you guess, it is one line you can read.
Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.
Discover more from SQL Authority with Pinal Dave
Subscribe to get the latest posts sent to your email.




