I would assume you store those date/times as unixtime in the database, and its literally as simple as subtracting 2 numbers and applying strftime to the result ???
Yes, subtracting two numbers is easy, but first I have to find some elusive glitch that causes round end time to be missed in stats counter.
Of course I can just subtract block timestamps that are always correct and get stats table instantly fixed, but this way I won't find the cause of that glitch.
Sorry for the inconvenience, I hope to solve this problem today.