rakzer has asked for the wisdom of the Perl Monks concerning the following question:
I have an x amount of seconds and would like to print it in a smart, human readable and intuitive format:
For instance:# no need to write days, hours, seconds but # write minute in singular $ perl nice-epoch 60 1 minute # both second and minute is written singular $ perl nice-epoch 61 1 minute, 1 second # write minute in singular $ perl nice-epoch 62 in 1 minute, 2 seconds # no need to write days/hours or seconds but # write seconds in plural $ perl nice-epoch 120 in 2 minutes # no need to write hours, minutes, seconds $ perl nice-epoch 65400005465 in 756944 days
I tried to write something like that on my own based on 101511 but with all the plural/singular, is it zero or not it gets endless complicated and I wonder if any of you could recommend a already existing module.
Rakzer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: smart human readable time epoch
by Anonymous Monk on Jun 15, 2011 at 09:01 UTC | |
by ikegami (Patriarch) on Jun 15, 2011 at 09:48 UTC | |
by rakzer (Novice) on Jun 15, 2011 at 09:37 UTC | |
by ikegami (Patriarch) on Jun 15, 2011 at 10:15 UTC | |
by Anonymous Monk on Jun 15, 2011 at 10:12 UTC | |
|
Re: smart human readable time epoch
by ikegami (Patriarch) on Jun 15, 2011 at 09:07 UTC | |
|
Re: smart human readable time epoch
by ambrus (Abbot) on Jun 15, 2011 at 09:28 UTC | |
|
Re: smart human readable time epoch
by jpl (Monk) on Jun 15, 2011 at 10:38 UTC | |
by Your Mother (Archbishop) on Jun 15, 2011 at 16:36 UTC |