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