Changing Timezones

Data types.

alter database postgres
set timezone to 'America/New_York';

Notes

Examples

Change timezone

alter database postgres
set timezone to 'America/New_York';

Full list of timezones

Get a full list of timezones supported by your database. This will return the following columns:

  • name: Time zone name
  • abbrev: Time zone abbreviation
  • utc_offset: Offset from UTC (positive means east of Greenwich)
  • is_dst: True if currently observing daylight savings
select name, abbrev, utc_offset, is_dst
from pg_timezone_names()
order by name;

Search for a specific timezone

Use ilike (case insensitive search) to find specific timezones.

select *
from pg_timezone_names()
where name ilike '%york%';