I am surprised that no one has asked about this before, but ... How can I trivially print NominalDiffTime in hours, minutes and seconds? (And maybe days if it takes so long ...)
For unknown reasons, the Show instance prints full seconds, which is obviously useless. (How much time is 13,055.22 seconds? Is it a few minutes? A day? Half an hour? I donβt know!)
There is a FormatTime class, but it does not apply to NominalDiffTime .
It seems you can use the floor method to get the total number of seconds as an actual number, but then what will you do with it?
As far as I can tell, DiffTime doesn't help either.
There must be a way to print the length of time ...
formatting time haskell
MathematicalOrchid
source share