Time zones DST and last_updated

Why do my ‘last_updated’ times show with no DST adjustment?

e.g. I’m currently on DST (+1) but I get

2020-06-21 08:05:58.785482+00:00

When actually it is 09:05:58

If this is normal and expected how do I display that time correctly in Lovelace?

(I have the correct time zone set in my Configuration)

Because it is in UTC and UTC does not change with DST.

{{ last_updated|as_timestamp|timestamp_local }}

Who knew?
Everyone except me I expect!
Thanks.

The +00:00 at the end indicates the amount of offset from UTC (formerly GMT). If the offset is zero then it means the time shown has no offset included and is UTC time.

To see what I mean, paste this into the Template Editor:

{{ utcnow() }}
{{ now() }}

The second line in the screenshot is telling me that the time shown is offset by -4 hours with respect to UTC. That’s correct because the first line is showing me UTC time and it’s precisely 4 hours ahead of the first line.

If you want to know if DST is currently in effect in your time zone, you can use this:

{{ now().timetuple().tm_isdst > 0 }}

It could also be, e.g., WET (Western European Time), and it’s not summer. In summer it would switch to WEST and be “+01:00”, whereas UTC never switches.

Try also:

{{ now().tzinfo }}
{{ utcnow().tzinfo }}
{{ states.DOMAIN.OBJECT_ID.last_updated.tzinfo }}