How can I filter time using LogQL syntax?

I am using Grafana to query my Loki logs.

I know that I can choose the time range using Query Explorer UI as shown in the screen shot.

Is there any way to specify the time range using the query expression, instead of the UI?

Like adding a time filter to this query:

{k8node="v141"} |~ "Current directory:"

so I can find logs of 3 days ago, 12 PM to 12 PM without the being have to click on the UI?

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.