module

Cjules::Util::Duration

Instance methods

cutoff!(s : String, error : String = "invalid duration: #{s}") : Time

Time.utc minus the parsed span; raises UsageError with error when unparseable.

Source
humanize(span : Time::Span) : String
Source
parse(s : String) : Time::Span | Nil

Parse strings like "30s", "5m", "2h", "7d", "1w".

Source