title: Local time zone offset in PostgreSQL
body: <p>My web app stores all timestamps in UTC without time zones. I have a shell/psql script that returns a list of recent logins, and I want that script to display login times in the server's local time zone (which may vary depending on where the server is and with daylight savings). </p>
  
  <p>To get an interval representing the difference between my database server's time zone and UTC, I'm currently using this hack:</p>
  
  <pre><code>SELECT age(now() at time zone 'UTC', now());
  </code></pre>
  
  <p>That works, but is there a more straightforward way?</p>
  
  <p>There's a server configuration parameter called "timezone" that returns a valid timezone string, but I don't think it's possible to access those parameters in a query. (I guess that's a separate question, but an answer to it would resolve the time zone issue.)</p>