Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalDateTime conversion fails on DST transition #538

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

LocalDateTime conversion fails on DST transition #538

oehme opened this issue Nov 4, 2013 · 3 comments
Milestone

Comments

@oehme
Copy link
Contributor

@oehme 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
Copy link
Member

@timowest timowest commented Nov 5, 2013

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

@oehme
Copy link
Contributor Author

@oehme 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
Improve LocalDateTimeTest
@timowest
Copy link
Member

@timowest 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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants