Open
Description
Describe the bug
The DateTime results will -8h when inserting long values using PrepareStatement with use_server_time_zone=false&use_time_zone=Asia/Shanghai. (ClickHouse Server timezone is UTC)
Expected: '1970-01-01 08:00:00.001000000'
Actual: '1970-01-01 00:00:00.001000000'
(timezone is Asia/Shanghai)
Code example
CREATE TABLE t_test
(
`timestamp` DateTime64(3)
)
ENGINE = Log;
try (
Connection connection = DriverManager.getConnection("jdbc:ch://localhost:8123/default?use_server_time_zone=false&use_time_zone=Asia/Shanghai", "default", "");
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO t_test VALUES (?)")
) {
preparedStatement.setLong(1, 1);
preparedStatement.execute();
}
Configuration
Environment
- Client version: 0.7.2
- Language version: java11