On 2021-02-10 21:41, Julien Pivotto wrote:
> To be honest, multiple users were impacted by this, included me. I
> ended
> up changing my alertmanager templates from
>
> .EndsAt.Format "Mon Jan 2 15:04:05"
>
> to
>
> .EndsAt.Local.Format "Mon Jan 2 15:04:05"
>
> which fixed my issue, but that was annoying.
>
> All my custom webhook receivers required an update like this too.
Unfortunately just formatting the date/time without specifying that you
wanted it in the local timezone only worked by luck rather than design.
Technically the date/time could have internally been in any timezone as
it would be expected users always specify how they want it displayed
(using Local, UTC, In, etc.)
I'd always recommend specifying the timezone to use whenever displaying
dates & times (that recommendation is not specific to Alertmanager).
It is very easy to be tripped up if making assumptions about the
timezone of the raw value (even assuming UTC which is often the case is
dangerous as systems can change or have bugs that adjust the timezone
but keep the actual value equivalent).
--
Stuart Clark