Hi,
in HA my user account is set to monday for first day of the week,
but when using {{ now().weekday() }} it’s off by a day.
I can’t figure out why, all settings seem to be correct in HA and the RPI running HA, what am I missing?
Now.weekday is the same for everyone.
And that is a good thing otherwise it would make sharing code very hard.
But the reason it’s off my one is because it’s zero indexed. So Monday is 0 not 1.
2 Likes
ok, makes sense.
so using {{ now().weekday() + 1 }} should be the solution.
now().weekday() = Monday is 0 and Sunday is 6
now().isoweekday() = Monday is 1 and Sunday is 7
1 Like
even better!
thank you for your help.