Skip to content

Instantly share code, notes, and snippets.

@AlexBaitov
Created March 29, 2019 10:19
Show Gist options
  • Select an option

  • Save AlexBaitov/fb4d0312f8c49b79220139dde3908925 to your computer and use it in GitHub Desktop.

Select an option

Save AlexBaitov/fb4d0312f8c49b79220139dde3908925 to your computer and use it in GitHub Desktop.
Postgresql timezone manipulation
-- https://www.postgresql.org/docs/9.6/view-pg-timezone-names.html
db=> select * from pg_timezone_names;
db=> begin;
BEGIN
db=> select now();
now
------------------------------
2019-03-29 10:16:19.87445+00
(1 row)
db=> set timezone='Asia/Novosibirsk';
SET
db=> select now();
now
------------------------------
2019-03-29 17:16:19.87445+07
(1 row)
db=> show timezone;
TimeZone
------------------
Asia/Novosibirsk
(1 row)
db=> rollback ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment