loki
loki copied to clipboard
Feature Request: dateInZone template function to select output timezone of dates
Is your feature request related to a problem? Please describe.
I'd like to specify the output timezone when using the date
template function and currently can't
Describe the solution you'd like
I think the best solution would be to add a template function for this purpose: {{dateInZone "2006-01-02" .date, "MST"}}
To be completely clear this would be {{dateInZone [output format] [input date] [output time zone]}}
Describe alternatives you've considered For Grafana: The typical alternative to this function is to hard code a dashboard time zone to the one you'd like. This works in most cases but our specific use case requires 'MST' for an internal use case but would still like to allow the user to customize the dashboard timezone for all other panels
The Loki based solution I see would probably be to keep the time in Unix Epoch seconds and adjust appropriately with a fixed constant. Obviously this won't work when timezones do their thing.
Additional context Add any other context or screenshots about the feature request here.