brk303 0 Posted January 1 (edited) Hello everyone, I would like to display a user friendly string describing duration. So that it would produce strings along the line of : "33 milliseconds" "15 seconds" "1 minute and 5 seconds" "1 hour and 3 minutes" "1 day and 6 hours and 15 minutes" Or something similar. EDIT: Also ,notice that it would not say "10 days and 32 seconds", nor "2 months and 12 minutes" because that's not how people describe time. IOW, if you get into hours, the milliseconds don't matter any more, if you get into days, the seconds don't matter, if you get into months, the minutes don't matter, and so on. I could code it myself, but I wonder if there is already an implementation somewhere that I am not aware of. Thanks for your time. Edited January 1 by brk303 Share this post Link to post
dummzeuch 1506 Posted January 1 (edited) SecondsToHumanReadableString in my dzlib. There are probably others which I am not aware of. I just noticed that you wanted milliseconds support. My function does not support these. Edited January 1 by dummzeuch 2 Share this post Link to post
EugeneK 19 Posted January 1 If you are on Windows you can check GetDurationFormatEx in Winapi 1 Share this post Link to post