valid

fnbool valid(string units)(int value) if (units == "months" || units == "hours" || units == "minutes" || units == "seconds") @safe pure nothrow @nogc

Returns whether the given value is valid for the given unit type when in a time point. Naturally, a duration is not held to a particular range, but the values in a time point are (e.g. a month must be in the range of 1 - 12 inclusive).

Parameters

unitsThe units of time to validate.
valueThe number to validate.
fnbool valid(string units)(int year, int month, int day) if (units == "days") @safe pure nothrow @nogc

Returns whether the given day is valid for the given year and month.

Parameters

unitsThe units of time to validate.
yearThe year of the day to validate.
monthThe month of the day to validate (January is 1).
dayThe day to validate.