Wheemer
(Wheemer)
January 10, 2023, 12:44pm
1
When I’m connected to a remote home assistant in another time zone, the graphs in history for a device, and likely elsewhere, are show in my local machines time zone. It should always be shown in the servers time zone.
Is this a bug? It’s been giving me a headache for three days.
I have the same question. Indeed when I go to my dashboard with the following code:
type: custom:button-card
name: >
[[[var d = new Date(); return d.toLocaleTimeString([], {hour: '2-digit',
minute:'2-digit',hourCycle: 'h23',});]]]
After reading further, I see that I can set the localization to the HA server,
Services can now respond with data, a new dialog for lock, sentence triggers, fewer backward-incompatible changes, Bluetooth proxies are now the fastest option, copy 'n paste in dashboards, brand n...
which gets history right, but my code still returns the time on my phone.
To fix my code, I just added my local timezone:
type: custom:button-card
name: >
[[[var d = new Date(); return d.toLocaleTimeString('en-US', {hour: '2-digit',
minute:'2-digit',hourCycle: 'h23',timeZone: 'America/Los_Angeles' });]]]