Influxdb: start of the week is Thursday. how to configure to start from monday/sunday ?

Created on 7 Nov 2016  路  5Comments  路  Source: influxdata/influxdb

when I group by time(1w). I still see week starting from Thursday . I want week to start from sunday or monday. Please let me know how to get it done. I spent 4,5 hours trying to figure it out. I am using 1.0.2 version

SELECT SUM(value) FROM measurement_name WHERE time >= '2016-10-09T18:30:00Z' AND time < '2016-11-07T18:29:59Z' GROUP BY time(1w)

Most helpful comment

So why not start from Monday or Sunday?
Is there any special reason?

It's because the epoch was a Thursday (1 January 1970). Influx only cares about epoch (a.k.a. unix) time. Which is also why you can't group by month.

All 5 comments

To group by week starting on monday: GROUP BY time(1w,4d)

So why not start from Monday or Sunday?
Is there any special reason?

So why not start from Monday or Sunday?
Is there any special reason?

It's because the epoch was a Thursday (1 January 1970). Influx only cares about epoch (a.k.a. unix) time. Which is also why you can't group by month.

So why not start from Monday or Sunday?
Is there any special reason?

It's because the epoch was a Thursday (1 January 1970). Influx only cares about epoch (a.k.a. unix) time. Which is also why you can't group by month.

Thanks

Was this page helpful?
0 / 5 - 0 ratings