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

in table view datetime is interpreted as of browser's timezone. #450

Open
eclipsenn opened this issue Sep 28, 2022 · 0 comments
Open

in table view datetime is interpreted as of browser's timezone. #450

eclipsenn opened this issue Sep 28, 2022 · 0 comments
Assignees
Milestone

Comments

@eclipsenn
Copy link

This might be another way to resolve #318.
Prerequisites:
grafana 8.4.4(fcfb01faeb)
plugin vertamedia-clickhouse-datasource @ 2.5.2

What happened:
in table view, datetime is interpreted as of browser's timezone.
Steps to reproduce:

  • set system timezone as UTC+3;
  • create table with datetime:
(
    dt DATETIME64,
    value Int64
)
ENGINE = MergeTree()
ORDER BY (dt)
SETTINGS index_granularity = 8192;
  • insert values(60 time points starting 2022-09-28 12:00:00 UTC - 12:00:59 UTC):
insert into test(dt, value)
with timeseries_cte as (
    select toDateTime(number) as dt,
    mod(number, 10) as value
    from numbers(1664366400, 60)
)
select dt, value from timeseries_cte;
  • add a panel with clickhouse datasource and the following query:
SELECT
    dt,
    --toTimezone(dt, 'UTC'),
    avg(value)
FROM market_risk.opst1228
GROUP BY dt
ORDER BY dt
  • select table view;
    Expected behaviour: datetimes are interpreted as UTC and shown unmodified
    Actual behaviour: datetimes were interpreted as browser's timezone(UTC+3) and modified so it's 9:00:00, 9:00:01 etc

image

The similar issue #318 was closed as wontfix since there was no way to interpret server timezone from Clickhouse HTTP response. It seems it's possible now via x-clickhouse-timezone header.
x-clickhouse-timezone: UTC
image

@Slach Slach added this to the 3.1.0 milestone Mar 28, 2024
@Slach Slach self-assigned this Mar 28, 2024
@Slach Slach modified the milestones: 3.2.0, 3.3.0 Jun 20, 2024
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

2 participants