Change time zone : Time zone « Date Time « SQL / MySQL






Change time zone

    
mysql>
mysql> CREATE TABLE TZ (COL1 TIMESTAMP);
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> INSERT INTO TZ VALUES ('2005-01-01 12:00:00');
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> SELECT * FROM TZ;
+---------------------+
| COL1                |
+---------------------+
| 2005-01-01 12:00:00 |
+---------------------+
1 row in set (0.00 sec)

mysql>
mysql> SET @@TIME_ZONE = '+10:00';
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> SELECT * FROM TZ;
+---------------------+
| COL1                |
+---------------------+
| 2005-01-02 06:00:00 |
+---------------------+
1 row in set (0.00 sec)

mysql>
mysql> drop table tz;
Query OK, 0 rows affected (0.00 sec)

   
    
    
    
  








Related examples in the same category

1.Check the time-zone
2.Change time zone for now
3.Time Zone Adjustments
4.Get the value of the TIME_ZONE system variable.
5.Check the time zone