Converting string to 'timestamp with timezone' in java
<p>I have a string "2016-07-21T21:30:47.492+0000" I want to save it in DB in a column  that has the datatype 'TIMESTAMP WITH TIMEZONE'. Kindly suggest the solution.</p>

<p>This is what I did:</p>

<pre><code>final SimpleDateFormat mdyFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSSSX");
final SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
final Date d1 = mdyFormat.parse(strDate);
final String mdx = sdf.format(d1);
</code></pre>