Mar-21-2019, 10:54 AM
I am trying to remember why I did create so sophisticated answer, but no success; In any case, I think that the expected by the OP answer would be something like
min(delta.seconds, (-delta).seconds)
, where delta
is difference between two datetime objects. So, the difference between two times 23:59:00
and 00:00:01
should be 61 sec.