26 Jan
2008
26 Jan
'08
5:38 a.m.
wonder whether the functions below are candidates for alexandria:
;;; Examples (format-duration nil 86401.5) => "1d0h0m1.50s"
(format-duration nil 86401 :format '(" ~,2F second~:P" " ~D minute~:P" " ~D hour~:P" " ~D day~:P")) => " 1 day 0 hours 0 minutes 1.00 second"
imho, such functionality should go into a lib that is specialized for date/time handling, because you solve one problem related to dates/time with this, but there are many more. where should the line be draw? i suggest to check out the local-time project. i'll also take a look how these functions would fit in there. -- attila