By default mysql uses system timezone. That is the server computer's timezone.
Get current timezone:
mysql> select @@global.time_zone; // Will return over all mysql timezone.That is in mysql every user can had separate timezone. This return common timezone.
mysql> select @@session.time_zone; // Will return current user's timezone.
Set timezone:
mysql> set GLOBAL time_zone = timezone; // Will set timezone for overall mysql.
mysql> set time_zone = timezone; // Will set timezone for current user.
Example timezone format: 'Europe/London', 'Asia/Kolkata'.
Get current timezone:
mysql> select @@global.time_zone; // Will return over all mysql timezone.That is in mysql every user can had separate timezone. This return common timezone.
mysql> select @@session.time_zone; // Will return current user's timezone.
Set timezone:
mysql> set GLOBAL time_zone = timezone; // Will set timezone for overall mysql.
mysql> set time_zone = timezone; // Will set timezone for current user.
Example timezone format: 'Europe/London', 'Asia/Kolkata'.
No comments:
Post a Comment