Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I want get Ubuntu system time, I have two options:

$ cat /etc/timezone

$ date
Sun Sep 15 14:45:02 EDT 2013

How can I find out if PostgreSQL is using utc or a utc offset, such as US/Eastern?

share|improve this question

You can use current_setting() function to get the TIMEZONE setting.

SELECT current_setting('TIMEZONE') TZ;

Sample output:

# SELECT  current_setting('TIMEZONE') TZ;
(1 row)

Here is SQLFiddle demo

share|improve this answer

To see all relevant settings for local time (and some irrelevant, too), you can use:

SELECT * FROM pg_settings
WHERE name ~* 'time'

In particular, the settings for TimeZone and lc_time should be of interest to you. (The time zone is not the only relevant detail for time format.) You get a short description in the column short_desc.) More details for these settings in the manual here.

If you are only interested in one particular setting, the shortest form is:

SHOW timezone;

Returns the same as SELECT current_setting('timezone') (like peterm provided), but the latter can also be integrated into DML SQL queries.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.