Influxdb: add time operator today()

Created on 19 Sep 2016  路  38Comments  路  Source: influxdata/influxdb

Feature Request

Proposal: [Description of the feature]

today() is a shortcut to midnight UTC of the current day. E.g. if it is September 19th, 2016, then today() returns 2016-09-16T00:00:00Z

Use case: [Why is this important (helps with prioritizing requests)]

Was brought up as a desired feature in the Austin 1-day class.

@desa can you elaborate?

1.x RFC kinfeature-request

Most helpful comment

bump, really wondering why this is not implemented yet, would be an awesome feature

All 38 comments

Not sure of the exact use case, but the main interest seemed to be for doing queries on the previous day or days, but disregarding the data from today.

Ahh, so something like

SELECT mean(value) FROM example WHERE time > today() - 12h AND time < today()

Seems like it would be more useful if we had timezone support, but it also seems like an easy one to add.

yup

Even if this only supports UTC "today" at first, we need to consider how the API would change if/when we support localized today. Perhaps an argument like today(-8) to specify today as UTC minus 8 hours.

+1

+1

+1

+1

+1
Does anyone know if this feature has been implemented or not?

still waiting :S

daily statistics with now() -1day will cut off data after xx:xx:xxh (from now time eg. 20:26:01h) from previous day cause -1day is -24h and not -todayHoursDone, not showing the max data of the prev day if it raises after that now time.

eg. past 7 days total blocked domains in pi-hole.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

unstale

bump, really wondering why this is not implemented yet, would be an awesome feature

Also would highly apprectiate this feature +1

I am also looking for this feature +1 !

A +1 here as well.

+1 for example, I have an IoT device recording the amount of water used. Each time the meter rotates 1 revolution a measurement of +1L is recorded. I want to be able to find out how much water has been used today and want this to be from midnight till now. I don't want the past 24h, I need today and today only. Without this feature, I'm not quite sure how to construct the query...

+1 for example, I have an IoT device recording the amount of water used. Each time the meter rotates 1 revolution a measurement of +1L is recorded. I want to be able to find out how much water has been used today and want this to be from midnight till now. I don't want the past 24h, I need today and today only. Without this feature, I'm not quite sure how to construct the query...

Same here, with a solar inverter. Want to know the today max/min/total production, the max/min produced in the past (without today)
Can't find a workaround ...

+3 years this issue was openned 馃槪

+1

I also need that.

+1 me too

+1

+1

This featurerequest is now almost 4 years old. A lot of people, including me, need it. Please implement it soon :)
An the meantime I have to create the query "external" something like
select * from Table where time >= '2020-06-13' and time < '2020-06-13' + 1d

+1

+1

Please can I add my request to this, too? Use-case is simple min and max temperature and ultraviolet levels per calendar day (so far) from my weather station. Tempted to play with a variant of dusk and dawn times, based on (heavily damped) ambient light-level changes too. Thanks in anticipation.

+1, I could currently use this

+1

+1

+1

+1

+1

+1

Count me in, trying to find a way to align a graph to 24h starting at midnight and this seems to be the missing link.

@beckettsean Since 2016, we've been able to run InfluxQL queries such as:

SELECT max("potato") FROM "tomato" WHERE time < now() + 1000d

... outlined in this blog post. What specific queries are you looking to run?

@alsargent I believe the aim of this ticket is implement a query feature that _excludes_ today's value in favor of the previous day. @reloxx13 summed it up I think.

+1 - also for solar inverter production calculations.

Was this page helpful?
0 / 5 - 0 ratings