Patch: Add setDate/Time/Timestamp with Calendars

From: Kim Ho <kho(at)redhat(dot)com>
To: pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>
Cc: Barry Lind <blind(at)xythos(dot)com>, Dave Cramer <Dave(at)micro-automation(dot)net>, Fernando Nasser <fnasser(at)redhat(dot)com>
Subject: Patch: Add setDate/Time/Timestamp with Calendars
Date: 2003-07-10 18:09:30
Message-ID: 1057860571.2081.216.camel@topanga.toronto.redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
fixgetTimeZone.diff text/x-patch 16.3 KB
test.java text/x-java 2.6 KB

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jochem van Dieten 2003-07-11 21:29:51 Re: Strange exception opening JDBC connection
Previous Message Kim Ho 2003-07-10 16:03:31 Patch to extend the tests for setObject with Date/Time/Timezone