Using variables to build start and stop parameters for range()

Hello there,

I like to use Grafana variables to build start and stop parameters for the range() function.

I have a custom date and shift input field created for that.

Here is an examples:

date : 2021-08-25
shift: 1

This should result in range(start: 2021-08-25T06:00:00Z, stop: 2021-0825T14:00:00)

So, I know I have to “if-else-if” throug the shift to get the different times. But in general my question is how can I build the time formate out of string?

Hi @ogoku and welcome to the forum :wave:

I’m curious: have explored using any of Grafana’s global variables?:

@mattabrams: Maybe I got you wrong, but I already know how to use global variables. But I do not know how to “convert” them to influx’s specific time fomat.