title: Postgres: "AT TIME ZONE 'localtime'"== "AT TIME ZONE 'utc'"?
body: <p>I'm struggling to understand how <code>"AT TIME ZONE 'localtime'"</code> exactly work? By playing with it, I found out that it acts exactly as <code>"AT TIME ZONE 'UTC'"</code>... But why? Is <code>"localtime"</code> a synonym of <code>"UTC"</code> in postgres? Or it comes from some setting (environment? connection timezone? although checked both, seems they are not related)...</p>
  
  <p>There's <a href="https://www.postgresql.org/docs/9.1/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT" rel="nofollow noreferrer"><code>"localtime"</code> function</a> but I think it is not involved here.</p>
  
  <p>Sample SQLs:</p>
  
  <pre><code># date
  Thu Dec  8 12:00:05 AEDT 2016
  
  # SELECT LOCALTIMESTAMP;
  ----------------------------
   2016-12-08 01:13:29.444725
  
  # SELECT LOCALTIMESTAMP AT TIME ZONE 'America/New_York';
  -------------------------------
   2016-12-08 06:08:31.183103+00
  
  # SELECT LOCALTIMESTAMP AT TIME ZONE'localtime';
  ------------------------------
   2016-12-08 01:09:25.294063+00
  
  # SELECT LOCALTIMESTAMP AT TIME ZONE 'utc';
   -------------------------------
   2016-12-08 01:09:44.32587+00 -- SAME AS ABOVE
  
   # SET TIME ZONE 'America/New_York';
  
   # SELECT LOCALTIMESTAMP;
   ----------------------------
    2016-12-07 20:13:34.924647
  
   # SELECT LOCALTIMESTAMP AT TIME ZONE 'localtime';
   ------------------------------
    2016-12-07 15:10:08.188197-05
  
   # SELECT LOCALTIMESTAMP AT TIME ZONE 'utc';
   ------------------------------
    2016-12-07 15:10:44.88332-05 -- SAME AS ABOVE
  </code></pre>
  
  <p>Any hint? Is it documented somewhere?</p>