-
Notifications
You must be signed in to change notification settings - Fork 619
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
Fixed date/time handling #110
base: master
Are you sure you want to change the base?
Conversation
@@ -311,46 +312,21 @@ public Date getDate(int col) throws SQLException { | |||
* @see java.sql.ResultSet#getDate(int, java.util.Calendar) | |||
*/ | |||
public Date getDate(int col, Calendar cal) throws SQLException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this moves the driver away from the JDBC spec by ignoring the user supplied Calendar/Timezone information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately there are no sqlite datatype like 'timestamp with timezone' in postgresql, so timezone information is lost during saving in sqlite database.
I like the idea of wrangling the date/time type. Looks like the driver is storing text formatted dates using the local timezone. That was probably a mistake. I'm concerned about backwards compatibility with this change. Need more eyeballs on this review. |
I'm getting +2 hours with Europe/Helsinki time zone when using |
@TuomasKiviaho A quick search tells me Helsinki is GMT+3 right now with DST. Are you saying your dates are actually +5 compared to GMT (and therefore +2 compared to what you expected)? Or are you saying they are GMT+2 ? Or some other combination? Fun with timezones... |
Hi, 14:01 saved as string became 16:01 when I applied the UTC timezone fix. I didn't investigate it any further than that. Works OK with machines set in UTC timezone. Below is the snipped that I'm using.
Using org.threeten could be slightly less fun, but that's another story. |
Yeah, problems along those lines are what I was expecting. Hmmm... |
Any news? |
# Conflicts: # src/test/java/org/sqlite/AllTests.java
SQLite's internal date and time functions use UTC time zone. So we need to adjust date/time formatting and scanning in library to always use UTC.