About

Jadira is the home for Sousan and Chris Pheby's open source projects. These are reusable open source Java modules that provide first class solutions using the most effective current JEE technologies.

Search
Tag Cloud
...
Login

Jadira Support > Bug: Daylight saving + Time Zone other than UTC

There is a bug in TimestampColumnDateTimeMapper class when dealing with Daylight saving and a time zone that is not UTC.
See the unit test below:


// fixture
final DateTimeZone AMERICA_SAOPAULO_ZONE = DateTimeZone.forTimeZone(TimeZone.getTimeZone("America/Sao_Paulo"));

TimestampColumnDateTimeMapper mapper = new TimestampColumnDateTimeMapper();
mapper.setJavaZone(AMERICA_SAOPAULO_ZONE);
mapper.setDatabaseZone(AMERICA_SAOPAULO_ZONE);

// exercise SUT
Timestamp timestamp = mapper.toNonNullValue(new DateTime(2013, 10, 22, 0, 0, 0, 0, AMERICA_SAOPAULO_ZONE));

// verify
assertThat(timestamp.getTime(), is(new DateTime(2013, 10, 22, 0, 0, 0, 0, AMERICA_SAOPAULO_ZONE).getMillis()));

September 2, 2013 | Unregistered CommenterGerson Motoyama

Please upgrade to the current 3.1.0.GA release which should address this issue.

March 11, 2014 | Registered CommenterChris