to get the seconds since something changed. It would be much cleaner to have a single function replacement (similar to the relative_time function, but computer friendly instead of human friendly)
Sure, but then you still have to write the function for returning a relative time string. Would be nice if there was a template which would return what we see in HA now: 5 seconds ago, 3 days ago, …