title: Getting date with timezone offset
body: <p>I am trying to extract the date from a query in postgres. The timestamp is stored as UTC, so if I have 1/1/2014 02:00:00, I want the date in pacific time, to be 12/31/2013, not 1/1/2014. I am really close, but both query 2 and 3 still return 1/1/2014.</p>
  
  <pre><code>SELECT '1-1-2014 02:00:00'::timestamp at time zone 'America/Los_Angeles';
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>2014-01-01 02:00:00-08
  </code></pre>
  
  <p>-</p>
  
  <pre><code>SELECT CAST('1-1-2014 02:00:00'::timestamp at time zone 'America/Los_Angeles' AS Date);
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>2014-01-01
  </code></pre>
  
  <p>but I want it to return <code>2013-12-31</code>.</p>
  
  <pre><code>SELECT CAST('1-1-2014 00:02:00'::timestamp at time zone 'America/Los_Angeles' AS Date) at time zone 'America/Los_Angeles';
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>2014-01-01 00:00:00
  </code></pre>
  
  <p>but I want it to return <code>2013-12-31 00:00:00</code></p>
  
  <p>I basically want to return the date in the timezone it is in, in this case the pacific timezone.</p>