Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8321173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:55:38+00:00 2026-06-08T22:55:38+00:00

How do I set timezone for psql to something other than my default (US/Central)?

  • 0

How do I set timezone for psql to something other than my default (US/Central)? Here’s what I’ve tried so far:

$ psql
psql (9.1.4, server 9.0.4)
...

$ psql -c 'show timezone'
  TimeZone  
------------
 US/Central

$ psql --set=timezone=US/Eastern -c 'show timezone'
  TimeZone  
------------
 US/Central

$ psql --variable=timezone=US/Eastern -c 'show timezone'
  TimeZone  
------------
 US/Central

Edit: I don’t want to change the server timezone, just the client.

Edit #2: I want it in non-interactive mode.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:55:40+00:00Added an answer on June 8, 2026 at 10:55 pm

    The psql doc says:

    -v assignment
    --set=assignment
    --variable=assignment
    Perform a variable assignment, like the \set internal command. Note that 
    you must separate name and value, if any, by an equal sign on the command line....
    

    But with the timezone it does not seem to work, perhaps because because of this:

     These assignments are done during a very early stage of start-up, 
     so variables reserved for internal purposes might get overwritten later.
    

    So, it seems you must either use the SET command inside psql, or either set the PGTZ environment variable:

    PGTZ=PST8PDT psql -c 'show timezone'
    

    Of course, if you are OK with setting the timezone globally for the user (not just for this individual psql instance), you might set that variable in its .bashrc file (if in Linux)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running on a Win2003 server, TimeZone set to (GMT -06:00) Central Time.
I'm working with Zend 1.8. I've set the default timezone to Europe/Helsinki, and I'm
Is there a way to set a .NET application's TimeZone to a value other
I have a spring/jdbc/oracle 10g application. The Oracle server database timezone is set to
I have the timezone set on the server to BST (British Daylight Savings Time),
there is a function in php to set default timezone- date_default_timezone_set('Asia/Calcutta'); but does this
I need to set default timezone for my ASP.NET to Asia/Dhaka or GMT+6 timezone.
My server's timezone is in Eastern Time. When I first built my members table
How to set timeZone for UILocalNotification to AM/PM.
I need to force any time related operations to GMT/UTC, regardless the timezone set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.