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

useServerTimeZone == true doesn't work #955

Closed
Dustangelms opened this issue Jun 17, 2022 · 3 comments · Fixed by #1763
Closed

useServerTimeZone == true doesn't work #955

Dustangelms opened this issue Jun 17, 2022 · 3 comments · Fixed by #1763
Labels
bug module-client Client API and all implementations usability what affects usability of the client
Milestone

Comments

@Dustangelms
Copy link

https://github.com/ClickHouse/clickhouse-jdbc/blob/c98c084e35ee68249274fcd273644545d90e82a3/clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/internal/ClickHouseConnectionImpl.java#L279-L282

The GregorianCalendar object is created using local default time zone, not server time zone.

@zhicwu
Copy link
Contributor

zhicwu commented Jun 19, 2022

Thanks @Dustangelms for pointing this out. It does not look correct but Calendar was used in a way to get consistent result from mysql interface. If you need to deal with timezone, it is recommended to use LocalDate/LocalDateTime/OffsetDateTime instead of legacy Date/Calendar API, also please be aware that the latter is 10 times slower.

@TheHett
Copy link

TheHett commented Feb 28, 2024

, it is recommended to use LocalDate/LocalDateTime/OffsetDateTime instead of legacy Date/Calendar API, also please be aware that the latter is 10 times slower

We can't because ClickHouse driver uses the type Date and GregorianCalendar internal

@chernser chernser added usability what affects usability of the client module-client Client API and all implementations labels Jun 18, 2024
@chernser chernser added this to the 0.6.4 Release milestone Jul 18, 2024
@chernser
Copy link
Contributor

Now timezone is taken from server response what should solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug module-client Client API and all implementations usability what affects usability of the client
Projects
None yet
4 participants