title: Timestamp variations between oracle and postgres
body: <p>Currently, I am working on migrating an Oracle database schema to Postgres. As part of it I have to convert a custom utility function in Oracle which generates timestamps based on timezone. But the values obtained from Oracle and Postgres seem to vary by one hour.</p>
  
  <p>Oracle:</p>
  
  <pre><code>SELECT (to_timestamp_tz('20300714 235959 CET','YYYYMMDD HH24MISS TZR') - to_timestamp_tz('19700101 000000 GMT','YYYYMMDD HH24MISS TZR'))
      as foo FROM dual;
  </code></pre>
  
  <p>yields <strong>+22109 21:59:59.000000</strong></p>
  
  <p>Postgres:</p>
  
  <pre><code>select ('20300714 235959'::timestamp AT TIME ZONE 'CET') - ('19700101 000000'::timestamp AT TIME ZONE 'GMT') as foo;
  </code></pre>
  
  <p>yields <strong>22109 days 22:59:59</strong></p>
  
  <p>I guess the reason for this difference is because of daylight saving but I am not sure. Can anyone help me out with this problem.
  I am using Postgres v9.6 and Oracle 12c.</p>