Need precise seconds of switch ON state from history statistics

hi.

how did you manage to change into seconds?

original code:

    def pretty_duration(hours)
        Format a duration in days, hours, minutes, seconds.
        seconds = int(3600  hours)
        if days  0
            return %dd %dh %dm % (days, hours, minutes)
        if hours  0
            return %dh %dm % (hours, minutes)
        return %dm % minutes 

what shall we delete?

tnx