Convert Date to TimeStamp with TimeZone of postgres
<p>I have postgresql time column with type <code>TIMESTAMP WITH TIME ZONE</code> having a sample value like <code>1970-01-01 00:00:00+05:30</code> I want to compare a value
with <code>Date</code> value like: </p>

<pre><code>Date date = new Date(0L);
</code></pre>

<p>i.e. Tue Jan 19 13:55:24 IST 2016 </p>

<p>So  I used </p>

<pre><code>Timestamp timeStampDate = new Timestamp(date.getTime());
</code></pre>

<p>The above code gives timeStampDate.getTime() as 0.</p>

<p>How to convert it in the above format so that it can be compared, Currently comparing is giving no results.
How to format this date.</p>

<p>I basically want to convert " Date is Thu Jan 01 05:30:00 IST 1970 " to this format : "1970-01-01 00:00:00+05:30"</p>