0

I have a Druid SQL query that returns data correctly for different timezones (UTC, EST), but the timestamp format is still shown in UTC (Z), even though the values are correct.

timestamp impressions 24-10-25T1:00Z 1000 24-10-25T2:00Z 2000 24-10-25T5:00Z 3000 24-10-25T6:00Z 4000 24-10-25T7:00Z 5000 24-10-25T8:00Z 6000

So in est I should be getting data like this timestamp impressions 24-10-25T1:00-04:00 3000 24-10-25T2:00-04:00 4000 24-10-25T3:00-04:00 5000 24-10-25T5:00-04:00 6000

but my query is giving the expected data that I want but its format is still in UTC, i.e. the timestamp is still having Z, and so inspite of the data being correct I am getting the format wrong for eg: timestamp impressions 24-10-25T1:00Z 3000 24-10-25T2:00Z 4000 24-10-25T3:00Z 5000 24-10-25T5:00Z 6000 here the data is correct but formatting isn't.

Query:

SELECT
  DATE_TRUNC('DAY', TIMESTAMPADD(HOUR, -4, __time)),
  SUM("impressions")
FROM aggregates
WHERE
  __time >= TIME_PARSE('2025-10-01T00:00:00',  NULL, 'America/New_York') AND
  __time < TIME_PARSE('2025-10-02T00:00:00',  NULL, 'America/New_York')
GROUP BY 1

Give me some suggestions or alternatives on how to proceed with it as I have tried "sqlTimeZone": "America/New_York" in the context but it is giving the data which has been a previous day's data according to the est timezone, which I don't want, and the other queries that I have tried is not giving me correct results.

Thanks!

1
  • 1
    If T1:00Z is "correct data" then T1:00-04:00 cannot be the expected output because those are different points in time. Please clarify. Commented Oct 25 at 22:13

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.