libtime-duration-perl

Module for rounded or exact english expression of durations
  https://metacpan.org/release/Time-Duration
  0
  no reviews



Time::duration provides functions for expressing time spans in rounded or exact terms. so while

say duration_exact(86399);
will correctly give "23 hours, 59 minutes, and 59 seconds",

say ago(86399);
will output the rounded time span as "1 day ago".

the provided functions are duration(), ago(), from_now(), later() and earlier(), along with their *_exact counterparts. the precision used for rounding can be specified, and version 1.10 added a millisecond mode.