Objective: To subtract 10 minutes from go's time.Time object(".StartsAt") in html template (In specific the prometheus alertmanager's email template: email_template.tmpl)
Code: <tr><td>error_timestamp</td><td>{{ .StartsAt }}</td></tr>
Alertmanager version: 0.20.0
Options tried and corresponding errors :
1. <td>{{ .StartsAt.Add(-10*time.Minute) }}</td> ::::::: Unexpected operand "("
2. <td>{{ .StartsAt.Add "-10*time.Minute" }}</td> ::::::: expected integer; found "-10*time.Minute\""
3. {{ $timestamp := .StartsAt.Add "10m" }} :::::::::::::::: wrong type for value; expected time.Duration; got string
4. {{ $timestamp := Add .StartsAt "10m" }} ::::::::::: Add function not defined
5. {{ $timestamp := .StartsAt.Add -10*time.Minute }} :::::::::::: time function not defined
6. {{ $timestamp := .StartsAt.Add (-10*time.Minute) }} :::::::::::: illegal operand *
7. {{ $timestamp := .StartsAt.Add (time.duration "10m") }} :::::::::::: duration function not defined
8. {{ $timestamp := .StartsAt.Add (time.ParseDuration "10m") }} :::::::::::: time function not defined
9. {{ $timestamp := .StartsAt.Add 10 }} ::::::::::: No error. But no change in timestamp too.