Thank you very much, this solved the problem!!
But donât understand that my first equation didnât work, Can you please explain that to me?? Maybe Iâll learn something from that.
The issue is that youâre comparing oranges to tangerines⌠they look similar, but inside theyâre different.
The strptime() function takes a string and format information and returns a datetime object, while strftime() takes a datetime object and format information to return a string⌠so in the end you are comparing a string to a datetime object. You basically just over converted.
Additionally, one is side timezone aware and the other is timezone naive. This wouldnât matter if both sides were strings since they are WYSIWYG, but it does matter for datetime objects.
Another equation, that is similar to your original would be the following, where we donât convert the left hand side of the equation.
Thank you very much for this explanation.
Iâll take a closer look at this one, because at first sight I donât understand it at all!! Iâm still fairly new here but trying to learn as much as possible. Do you know where there is a good course to understand all this a little better.
Jinja Docs: As you may have discovered, these docs are not geared toward new/casual users, but they contain a lot of important information.
Jinja for Ninjas: @skalavala has put together a well organized tutorial and group of examples. Since the HA devs and community are regularly adding template functions, there may be better/easier ways to do some of the things shown, but itâs still a great source. They also have a Jinja Cheatsheet you can download.
Many Python methods also to work in templates. Iâve never seen a complete list of which methods work and which donât⌠But the Official Python docs have come in handy for me multiple times to figure out whatâs going on in templates posted by some of the more advanced users on this forum.