Re: Convert Timestamp to Date? - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: Convert Timestamp to Date?
Date
Msg-id 3BE7709F.4090801@xythos.com
Whole thread Raw
In response to Convert Timestamp to Date?  ("Dr. Evil" <drevil@sidereal.kz>)
List pgsql-jdbc
There is not need to convert these two datatypes.  Timestamp is a
subclass of Date.  Thus in the OO sense a Timestamp object is a Date
object.  You can just cast a Timestamp object to a Date.

thanks,
--Barry

Dr. Evil wrote:

> Hi, is there a way to convert java.sql.Timestamp to java.util.Date
> type?  It seems like there should be because Timestamp is basically a
> wrapper for Date, but there doesn't seem to be any method to do this.
> I could have Timestamp output a string and then have Date parse the
> string, but that seems very inefficient.
>
> Thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>



pgsql-jdbc by date:

Previous
From: Liam Stewart
Date:
Subject: Re: Funny timezone shift causes failure in test suite
Next
From: Barry Lind
Date:
Subject: Re: Backend Protocol