Change time zone
Moderator: NorbertKrupa
Change time zone
Hi, How do I change the database time zone is a session? Thank you.
Thank you!
Joshua
Joshua
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Change time zone
Josh,
You can use the SET TIME ZONE command to change the time zone.
Example:
You can use the SET TIME ZONE command to change the time zone.
Example:
Code: Select all
dbadmin=> show time zone;
name | setting
----------+------------
timezone | US/Eastern
(1 row)
dbadmin=> select current_timestamp;
?column?
-------------------------------
2012-02-21 10:16:51.568814-05
(1 row)
dbadmin=> set time zone = 'Asia/Harbin';
SET
dbadmin=> show time zone;
name | setting
----------+-------------
timezone | Asia/Harbin
(1 row)
dbadmin=> select current_timestamp;
?column?
-------------------------------
2012-02-21 23:16:51.568814+08
(1 row)
dbadmin=> set time zone to default;
SET
dbadmin=> show time zone;
name | setting
----------+------------
timezone | US/Eastern
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.