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

Inserted DateTime value has +10 hours offset #11

Closed
Eshafottt opened this issue Oct 3, 2017 · 1 comment
Closed

Inserted DateTime value has +10 hours offset #11

Eshafottt opened this issue Oct 3, 2017 · 1 comment

Comments

@Eshafottt
Copy link

Hi, Andrey.

I'm using ClickHouse.ADO

If I insert DateTime values in DateTime columns in table they will have +10 hours offset.
For example 03.10.2017 12:30:00 becomes 03.10.2017 22:30:00.

It doesn't matter whether date is utc or local, it will be changed +10 hours anyway. I tested databases on different servers, one with +3 utc, other with +5 utc and other with +10 utc. But all of those had +10 hours offset. I am now in Vladivostok which has +10 utc. So I thought maybe it was the reason of the problem. I tried to change time on my local machine, but that changed nothing.

I tried to insert DateTime values using other ClickHouse clients such as DBeaver. And it worked nice. DateTime values were being inserted as they had to be. So I decided that problem in ClickHouse.ADO.

I researched your source and tried changing value of "use_client_time_zone" in QuerySettings, but it didn't help. I also have known than you calculate DateTime as a number of seconds since Unix date and then pass bytes of that number to the stream. So maybe problem is somewhere around it? What do you think?

@Eshafottt
Copy link
Author

The problem is that ClickHouse clients add local time offset to DateTime values.

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

No branches or pull requests

1 participant