Server timezone

777 views
Skip to first unread message

Itai Shirav

unread,
Feb 7, 2017, 5:14:14 AM2/7/17
to ClickHouse
Hi,

When getting datetime values from clickhouse, they are converted to the server's timezone. So in order to interpret these values correctly, the client needs to know which timezone was used.
  • Is it possible to get the server's timezone (using the http interface)?
  • Can the client set a different timezone for the session?
Thanks

Pavel Artemkin

unread,
Feb 7, 2017, 5:54:59 AM2/7/17
to ClickHouse
Hi.


>>> Can the client set a different timezone for the session?
You can force client's timezone:

SET use_client_time_zone = 1;


вторник, 7 февраля 2017 г., 15:14:14 UTC+5 пользователь Itai Shirav написал:

Itai Shirav

unread,
Feb 7, 2017, 5:59:01 AM2/7/17
to ClickHouse
Would this work using the http interface? I don't see any way to actually inform the server which timezone is being used by the client...

Pavel Artemkin

unread,
Feb 7, 2017, 7:02:09 AM2/7/17
to ClickHouse
No, it works only with clickhouse-client but you can discover server's time-zone by executing following query:

SELECT timezone()  // available in latest version of ClickHouse


вторник, 7 февраля 2017 г., 15:59:01 UTC+5 пользователь Itai Shirav написал:

Itai Shirav

unread,
Feb 7, 2017, 7:05:19 AM2/7/17
to ClickHouse
That's great!
You should add it to the documentation.
Reply all
Reply to author
Forward
0 new messages