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

incorrect timezone handling for java.sql.Time #2020

Open
peterhalicky opened this issue Jan 8, 2025 · 1 comment
Open

incorrect timezone handling for java.sql.Time #2020

peterhalicky opened this issue Jan 8, 2025 · 1 comment
Labels

Comments

@peterhalicky
Copy link

peterhalicky commented Jan 8, 2025

  1. What version of JDBC driver are you using?
    3.21.0

  2. What operating system and processor architecture are you using?
    MacOS 15.2, Apple Silicon (ARM)

  3. What version of Java are you using?
    openjdk 21.0.5 (temurin)

  4. What did you do?

Create a table with a TIME column, insert a row with value 12:34:56. My local timezone is UTC+1, snowflake is in UTC.
See: https://github.com/peterhalicky/snowflake-jdbc-time-bug

  1. What did you expect to see?

I expect that when I query the row and use ResultSet.getTime on the column, I get the same value. But instead I got 11:34:56. I suspect this is a problem in the JDBC driver, since snowflake as such doesn't really carry timezone in the TIME column. I would expect that PreparedStatement.setTime() and ResultSet.getTime() are consistent when converting to/from java.sql.Time.

  1. Can you set logging to DEBUG and collect the logs?

Attached.
snowflake_jdbc0.log

@peterhalicky
Copy link
Author

Note that the problem seems to be on insert (i.e. PreparedStatement.setTime()); when I inspect the table contents at app.snowflake.com (the web interface), it's showing 11:34:56.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant