The question is pretty self-explanatory. I found this documentation here:
https://www.postgresql.org/docs/current/view-pg-timezone-names.html
However, it does not really mention how to get a list of all the supported timezones. How can I do this?
The answer from Tim was excellent. For whatever reason my Postgres DB also contained a bunch of fluff with the prefix "posix/" and I also needed these in alphabetical order to use on a website, so I did this:
SELECT
name,
abbrev,
utc_offset,
is_dst
FROM pg_timezone_names
WHERE name !~ 'posix'
ORDER BY name asc;
You may try selecting from the view pg_timezone_names
, as the documentation says:
The view pg_timezone_names provides a list of time zone names that are recognized by SET TIMEZONE, along with their associated abbreviations, UTC offsets, and daylight-savings status.
Try the following query:
SELECT
name,
abbrev,
utc_offset,
is_dst
FROM pg_timezone_names;
I ran this query and pasted the results here if anybody wants to save the time of running it themselves.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With