Many times different time zones can create some confusion among the developers. Therefore, there is a need to check the current time zone of MySQL in a lot of cases. In this article, we will learn how to check the current time zone of MySQL.
The time zone of MySQL can be retrieved using the time zone variables. Let us see how to use them for the purpose.
@@system_time_zone
Observe the below query to get the current time zone.
SELECT @@system_time_zone;
Output:-
The output in image_1 shows that the current time zone of MySQL is IST.
@@GLOBAL.time_zone
Frequently Asked:
The @@GLOBAL.time_zone gets the global time zone value. Observe the below query.
SELECT @@GLOBAL.time_zone;
Output:-
The output in image_2 shows that MySQL takes the global time zone value from what is set in the working system.
@@SESSION.time_zone
The @@SESSION.time_zone gets the session time zone value. Observe the below query.
SELECT @@SESSION.time_zone;
Output:-
The output in image_3 shows that MySQL takes the session time zone value from what is set in the working system.
now()
MySQL function now() will return the date and time values as per the timezone set for MySQL. Observe the below query.
select now();
Output:-

READ MORE:
- Find all tables with specific column names in MySQL
- MySQL add primary key multiple columns
- Mysql update set multiple columns
- Mysql update column with value from another table
- Select all columns except one of a MySQL table
- MySQL ADD COLUMN IF NOT EXISTS
- MYSQL: change column order
- MySQL: change column type to VARCHAR without losing data
- MySQL get column names
We hope this article helped you to get the current time zone of MySQL. Good Luck!!!