valid
fn
bool valid(string units)(int value) if (units == "months" ||
units == "hours" ||
units == "minutes" ||
units == "seconds") @safe pure nothrow @nogcReturns 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
units | The units of time to validate. |
value | The number to validate. |
fn
bool valid(string units)(int year, int month, int day) if (units == "days") @safe pure nothrow @nogcReturns whether the given day is valid for the given year and month.
Parameters
units | The units of time to validate. |
year | The year of the day to validate. |
month | The month of the day to validate (January is 1). |
day | The day to validate. |