I'm surprised nobody has asked this before, but... How do I trivially print a NominalDiffTime
as hours, minutes and seconds? (And possibly days, if it happens to be that long...)
For reasons unknown, the Show
instance prints total seconds, which is obviously useless. (How long is 13,055.22 seconds? Is that a few minutes? A day? Half an hour? I have no idea!)
There's the FormatTime
class, but it doesn't apply to NominalDiffTime
.
It seems you can use the floor
method to get total seconds as an actual number, but then what do you do with it?
As far as I can tell, DiffTime
doesn't help either.
There must be a way to print time durations sanely...