Hi All,
I am using the Google Calendar component and currently have multiple calendars all showing the next event. What i would like to do is remove the seconds from all event times and if event all day hide the time. (Just showing date).
Here is what i have so far but cannot figure out how to change the time strings to what i want. (using sensor templates)
I do apologize, that should of been obvious. I achieved that with: {% set s_date = as_timestamp(states.calendar.contacts.attributes.start_time) | timestamp_custom("%d %b") %}
Then added that to the end to get the result i like.
Still struggling with timezones as this week clocks change into daylight savings, appointments in BST currently show an hour ahead of what they should. I want always Google time rather than any conversion to my timezone.
Sorry, didn’t see your post til now. Yes, there are many ways to achieve what you want. WHat you posted is just one option. The other is to use strptime(entity_time).strftime(“format”).
Thank you for the pointers but i must still be using it wrong.
From documentation is see templates: strptime(string, format) will parse a string to a datetime based on a format.
So i then do; strptime(states.calendar.contacts.attributes.start_time, "%H:%M")
I cannot figure out how to use your suggestion. (This is just to get the %H:%M from calendar without converting to local timezone)
Thanks