-
-
Save hiepndd/51ef0e4a5e3ce0c7d7c395e87f2a3ef0 to your computer and use it in GitHub Desktop.
[Timezone in postgresql] get and set timezone in #postgresql #sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- timezone abrev list | |
select * from pg_timezone_names ; | |
-- set timezone TO 'pg_timezone_names.name' | |
set timezone TO 'posix/Africa/Tunis'; --(GMT+01) | |
set timezone TO 'GMT'; --(UTC/GMT) | |
-- read current timezone: | |
SELECT current_setting('TIMEZONE') | |
--reset timezone for database | |
alter database DATABASE_NAME set timezone TO 'posix/Africa/Tunis'; --(GMT+01) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment