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

Support timezone for a user-friendly way of setting the timezone offset #6541

Closed
jsternberg opened this issue May 3, 2016 · 5 comments
Closed

Comments

@jsternberg
Copy link
Contributor

From a conversation in #2074.

We should support a more user-friendly way to set timezone offsets. In 0.13, you will be able to set an offset with an extra parameter in the GROUP BY time(...) section like this:

SELECT mean(value) FROM cpu WHERE time > now() - 7d GROUP BY time(1d, -5h)

It should also be possible to set this timezone offset through doing something like this:

SELECT mean(value) FROM cpu WHERE time > now() - 7d GROUP BY time(1d) TZ("America/New York")

This should automatically set the group by offset and could potentially be used for something else like handling daylight savings time switches.

@giko45
Copy link

giko45 commented May 3, 2016

note that using a offset and using TZ("America/New York") is (should) not be the same

the TZ implementation requires
1: times in the database are in UTC
2: before the grouping: convert all "time"-s in to the required TZ
3: do the grouping (since "time" now is a local time grouping will handle DST, and yes this will imply one day per year with 23 h and one day with 25h but thats OK ). Here the offset syntax will not be able to handle DST
4: last step i am not totally sure: *Should the result be converted back to UTC? * in case of continues queries: yes, you don't want to save local times in you DB. In case of client queries: probably yes too. only return UTC times to the client. this just might seem a bit strange since you will get daily aggregated values att an offset in UTC. However its the clients responsibility to present this correct.

@jufemaiz
Copy link

jufemaiz commented Jul 7, 2016

Further to this, please do not conflate offsets with timezones.

https://spin.atomicobject.com/2016/07/06/time-zones-offsets/

@sebito91
Copy link
Contributor

This feature would actually be incredible, our support model is traditional follow-the-sun and it's difficult for some remote users to mentally adjust for timezones. Explicit settings would help tremendously.

@sebastianherp
Copy link

+1

Timezone support is a must have. The offset allows to handle that client side by changing the query depending on DST/TZ, but it really should be handled on the server to support queries that have an offset change in the middle of the selected time range.

@inselbuch
Copy link

has this been removed in 1.5?

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

No branches or pull requests

9 participants