Check Time zone in MySQL

Check the time zone in MySQL

SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;

Check the data value in different time zone:

SELECT NOW();
SET global time_zone='Asia/Kolkata';
SELECT NOW();
SET time_zone = '+8:00';
SELECT NOW();

Example:

mysql> SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;
+--------------------+---------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone |
+--------------------+---------------------+
| +00:00             | SYSTEM              |
+--------------------+---------------------+

mysql> SET GLOBAL time_zone = '+8:00';

mysql> SET GLOBAL time_zone = '+8:00';
mysql> SET GLOBAL time_zone = 'Europe/Helsinki';

If you got error follow the following link:

mysql> SET GLOBAL time_zone = ‘US/Eastern’;
ERROR 1298 (HY000): Unknown or incorrect time zone: ‘US/Eastern’

ERROR 1298 (HY000): Unknown or incorrect time zone: ‘US/Eastern’

Leave a Reply