title: DB2 Convert ISO 8601 timestamp string to DB2 timestamp
body: <p>I have a requirement where I get two strings in ISO 8601 Timestamp format and I have to compare them and get the max timestamp of them. The strings are in the following format.</p>
  
  <pre><code>2014-06-11T16:45:45Z
  </code></pre>
  
  <p>To compare, I need to cast them into DB2 timestamp and then compare. The problem is with the "T" and "Z" letters. Because of that, I am unable to cast. I know that I can simply  <code>REPLACE</code> the T and Z and cast, but I wanted to know if there is a better way.</p>
  
  <p>I tried the following functions but was not able to get the desired results.</p>
  
  <pre><code>to_date, to_timestamp, varchar_format, cast as
  </code></pre>
  
  <p>Using DB2 LUW v9.7</p>