LocalDateTime conversion fails on DST transition #538

Closed
oehme opened this Issue Nov 4, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@oehme
Contributor

oehme commented Nov 4, 2013

I have outlined the issue in this blog post.

http://mnmlst-dvlpr.blogspot.de/2013/11/joda-time-to-jdbc-in-three-hard-lessons.html

In short: Relying on the default time zone when converting from partial to instant is not safe.

timowest added a commit that referenced this issue Nov 5, 2013

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Nov 5, 2013

Member

Thanks for the bug report. Could you review the changes?

Member

timowest commented Nov 5, 2013

Thanks for the bug report. Could you review the changes?

@oehme

This comment has been minimized.

Show comment
Hide comment
@oehme

oehme Nov 6, 2013

Contributor

You can simplify LocalTime by just calling

value.getMillisOfDay()

instead of

value.toDateTimeToday().getMillis()

This is also more in line with the JDBC spec which says that the date parts should be 1970-1-1.

Otherwise the changes look good to me. It would be a good idea to add a cross-database test for dates and times. With all the corner cases like leap years and DST transitions.

Contributor

oehme commented Nov 6, 2013

You can simplify LocalTime by just calling

value.getMillisOfDay()

instead of

value.toDateTimeToday().getMillis()

This is also more in line with the JDBC spec which says that the date parts should be 1970-1-1.

Otherwise the changes look good to me. It would be a good idea to add a cross-database test for dates and times. With all the corner cases like leap years and DST transitions.

timowest added a commit that referenced this issue Nov 6, 2013

Simplify LocaTime usage #538
Improve LocalDateTimeTest
@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Nov 17, 2013

Member

Released in 3.3.0.BETA1

Member

timowest commented Nov 17, 2013

Released in 3.3.0.BETA1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment