Alerting: Update grafana/alerting to bb4f4f4 (#86827)
This commit is contained in:
@@ -74,10 +74,19 @@ In addition to iterating over each key value pair, you can sort the pairs, remov
|
||||
|
||||
### Time
|
||||
|
||||
Time is from the Go [`time`](https://pkg.go.dev/time#Time) package. You can print a time in a number of different formats. For example, to print the time that an alert fired in the format `Monday, 1st January 2022 at 10:00AM` you would write the following template:
|
||||
Time is from the Go [`time`](https://pkg.go.dev/time#Time) package.
|
||||
|
||||
You can format a time in a number of different formats using the `date` function.
|
||||
For example, to print the time that an alert fired in the format `15:04:05 MST`:
|
||||
|
||||
```
|
||||
{{ .StartsAt.Format "Monday, 2 January 2006 at 3:04PM" }}
|
||||
{{ .StartsAt | date "15:04:05 MST" }}
|
||||
```
|
||||
|
||||
You can also use the `tz` function to change the timezone from UTC to a local time. For example:
|
||||
|
||||
```
|
||||
{{ .StartsAt | tz "Europe/Paris" | date "15:04:05 MST" }}
|
||||
```
|
||||
|
||||
You can find a reference for Go's time format [here](https://pkg.go.dev/time#pkg-constants).
|
||||
|
||||
Reference in New Issue
Block a user