Time::Duration is probably the right one. It converts seconds into an English equivalent (e.g. "20 days, 4 hours, 13 minutes, and 25 seconds ago") with support for truncating to an approximation (e.g. "20 days, 4 hours ago").
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
| [reply] |
xdg,
As does my RFC: Seconds2English. It won't however give you a response like 'yesterday' and 'last month'. That is why I said any solution is likely going to need to be tweaked for the specific responses.
| [reply] |