From: | Barry Lind <barry(at)xythos(dot)com> |
---|---|
To: | "Dr(dot) Evil" <drevil(at)sidereal(dot)kz> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Convert Timestamp to Date? |
Date: | 2001-11-06 05:09:51 |
Message-ID: | 3BE7709F.4090801@xythos.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Nick Fankhauser | 2001-11-06 15:14:23 | Re: |
Previous Message | Barry Lind | 2001-11-06 05:07:43 | Re: Documentation PostgreSQL-specific JDBC methods |