Patch: Add setDate/Time/Timestamp with Calendars - Mailing list pgsql-jdbc

From Kim Ho
Subject Patch: Add setDate/Time/Timestamp with Calendars
Date
Msg-id 1057860571.2081.216.camel@topanga.toronto.redhat.com
Whole thread Raw
List pgsql-jdbc
This patch implements the setDate/Time/Timestamp with Calendars.

If the user specifies a calendar, the setDate/Time/Timestamp will change
the time given into the target timezone. The base timezone is always the
local jvm timezone.

If the user doesn't specify a calendar, it is not used.

Here is a test. The test program is test.java. The first time is in PST.
The second in EST.

Before patch:

     a
------------
 1999-12-31
 1999-12-31
(2 rows)

      a
-------------
 12:00:00-04
 12:00:00-04
(2 rows)

    a
----------
 12:00:00
 12:00:00
(2 rows)

           a
------------------------
 1999-12-31 12:00:00-05
 1999-12-31 12:00:00-05
(2 rows)

          a
---------------------
 1999-12-31 12:00:00
 1999-12-31 12:00:00
(2 rows)


After patch:

     a
------------
 1999-12-30
 1999-12-31
(2 rows)

      a
-------------
 09:00:00-04
 12:00:00-04
(2 rows)

    a
----------
 09:00:00
 12:00:00
(2 rows)

           a
------------------------
 1999-12-31 09:00:00-05
 1999-12-31 12:00:00-05
(2 rows)

          a
---------------------
 1999-12-31 09:00:00
 1999-12-31 12:00:00
(2 rows)


Cheers,

Kim

Attachment

pgsql-jdbc by date:

Previous
From: Paul Thomas
Date:
Subject: Re: Information needed
Next
From: Dave Cramer
Date:
Subject: Re: Information needed