Time and range is not part of query, it’s part of the API request. You can see the API call sent to Loki from your Grafana’s query inspector, and you’ll see how time range is supplied. If you really want to I think you can probably do it with template, but I don’t think it’s worth the hassle even if it’s possible.