Use correct time delta function
The .seconds attribute of a timedetla object cannot be taken in
isolation because it can overflow into days. For example, a -1 second
difference will become -1 day and 86399 seconds.
This became a problem when the agent clock was slightly ahead of
the server clock. When calling (server_time - agent_time).seconds
in this scenario, it would go below 0 in the daily seconds and
wraparound to 86399 seconds and -1 day.
This patch corrects the issue by using a method in timeutils that
ends up calling total_seconds(), which was designed for this usecase.
It also restores the formatting that was removed in patch:
Ibfc30444b7a167fb18ae9051a775266236d4ecce
Closes-Bug: #
1456760
Change-Id: Ie90249ab68bb5f8d117872d52180c7087d8fac9b