kameloso.time

Various functions that deal with Durations.

Members

Classes

DurationStringException
class DurationStringException

A normal Exception but where its type conveys the specific context of a call to abbreviatedDuration having malformed arguments.

Functions

asAbbreviatedDuration
auto asAbbreviatedDuration(string line)

Constructs a Duration from a string, assumed to be in a *d*h*m*s pattern.

nextMidnight
auto nextMidnight(SysTime now)

Returns a SysTime of the following midnight.

timeSince
string timeSince(Duration duration, bool abbreviate, bool roundUp)

Express how much time has passed in a Duration, in natural (English) language. Overload that returns the result as a new string.

timeSinceInto
void timeSinceInto(Duration signedDuration, Sink sink, bool abbreviate, bool roundUp)

Express how much time has passed in a Duration, in natural (English) language. Overload that writes the result to the passed output range sink.

Meta