title: How do I prevent Redshift INSERT datetime from dropping the timezone?
body: <p>I have a <strong><code>String</code></strong> in this format: <code>2018-11-01T00:00:00-07:00</code> and I would like to convert it to a <code>TIMESTAMP</code> and insert it into a <code>TIMESTAMP</code> column. However, when I insert it, it drops the <code>-07:00</code> without first converting it to <code>-00:00</code>. How do I ensure that it is converted and stored in Redshift properly?</p>
  
  <p>Here is an example:
  <code>select ORIGINAL_DATE, TO_TIMESTAMP(ORIGINAL_DATE,'YYYY-MM-DD HH24:MI:SS') FROM CDW_LANDING.X where id = XXXXXX;</code></p>
  
  <p>=> <code>2018-11-01T00:00:00-07:00   2018-10-31 17:00:00</code></p>
  
  <p>The <code>TO_TIMESTAMP</code> converts it to <code>2018-10-31 17:00:00</code> which is what I want. However, when I insert it, it becomes <code>2018-11-01 00:00:00</code> and simply drops the <code>-07:00</code>.</p>
  
  <p>Here is the example:</p>
  
  <pre><code>insert into cdw_stage.X (ORIG_DT) 
  select TO_TIMESTAMP(ORIGINAL_DATE,'YYYY-MM-DD HH24:MI:SS') 
  from CDW_LANDING.INVOICE where id = XXXXXX;
  </code></pre>
  
  <p>But when I query it with <code>select ORIG_DT from cdw_landing.X;</code>, it displays <code>2018-11-01 00:00:00</code>. What I would like to see is <code>2018-10-31 17:00:00</code> which is what the <code>TO_TIMESTAMP</code> function should do. </p>
  
  <p>The <code>ORIG_DT</code> in Redshift is in <code>TIMESTAMP</code> format. The input date is in <code>VARCHAR</code>.</p>
  
  <p>How do I get Redshift to save this correctly? I also added postgres tag because Redshift is based off of postgres. Thank you so much!!!</p>