Closed thjaeckle closed 10 months ago
Additional idea: Rounding up/down to the next full "ms" | "s" | "m" | "h" | "d"
.
Syntax could be e.g.:
time:now_round-d # rounding down to today's start of the day
time:now-1d_round-d # rounding down to yesterday's start of the day
time:now-1d_round-h # rounding down to yesterday's start of the current hour
time:now_round+m # rounding up the current time to the next full minute
Or:
time:now_floor_d # rounding down to today's start of the day
time:now-1d_floor_d # rounding down to yesterday's start of the day
time:now-1d_floor_h # rounding down to yesterday's start of the current hour
time:now_ceil_m # rounding up the current time to the next full minute
Or:
time:now[-d] # rounding down to today's start of the day
time:now-1d[-d] # rounding down to yesterday's start of the day
time:now-1d[-h] # rounding down to yesterday's start of the current hour
time:now[+m] # rounding up the current time to the next full minute
Currently, there is the
time:now
placeholder which can be used in RQL queries, e.g. like this:The currently implemented time placeholders are:
time:now
time:now_epoch_millis
It would be very useful to be able to also specify a plus and minus offset to "now":
Syntax idea: To keep it simple, the existing placeholders could support optionally the following syntax:
Where Ditto duration is defined by implementation class
DittoDuration
.Examples:
time:now-5h
- current ISO8601 timestamp minus 5 hourstime:now_epoch_millis+2d
- current epoch timestamp plus 2 daystime:now+30s
- current ISO8601 timestamp plus 30 seconds