To know the current time, we can use the now() function with SELECT statement. The query is as follows −
mysql> SELECT now();
After executing the above query, we will get the current time. The following is the output −
+---------------------+ | now() | +---------------------+ | 2018-10-06 12:57:25 | +---------------------+ 1 row in set (0.02 sec)
To set the time zone, we can use the command SET. The syntax is as follows −
mysql> SET time_zone = "Some value";
Now I am applying the above query to set the time zone. The query is as follows −
mysql> SET time_zone = "+9:50"; Query OK, 0 rows affected (0.00 sec)
We can set globally as well with the help of SET command −
mysql> set global time_zone="+9:00"; Query OK, 0 rows affected (0.00 sec)