Convert a Scrape Sensor date string to timestamp

I have a scrape sensor and it returns a date as a string - “Mon, 01 April 2019”

Is the a way to convert this to a timestamp so I can use it in value templates ?


There IS a way :slight_smile: :

{{ strptime(states("sensor.sensor_name"), "%a, %d %B %Y") }}

Thank you so much, worked like a charm with a few additions to get the difference between that and now

1 Like