Back

duration (clj)

(source)

function

(duration duration-ms) (duration duration-ms options)
Converts duration, in milliseconds, into a string describing it in terms of years, months, weeks, days, hours, minutes, and seconds. Ex: (duration 325100) => "five minutes, twenty-five seconds" The months and years periods are not based on actual calendar, so are approximate; this function works best for shorter periods of time. The optional options map allow some control over the result. :list-format (default: a function) can be set to a function such as oxford :number-format (default: numberword) function used to format period counts :short-text (default: "less than a second")

Examples