The OpenD Programming Language

validTimeUnits

Whether all of the given strings are valid units of time.

"nsecs" is not considered a valid unit of time. Nothing in std.datetime can handle precision greater than hnsecs, and the few functions in core.time which deal with "nsecs" deal with it explicitly.

@safe pure nothrow @nogc
bool
validTimeUnits
(
string[] units...
)

Examples

assert(validTimeUnits("msecs", "seconds", "minutes"));
assert(validTimeUnits("days", "weeks", "months"));
assert(!validTimeUnits("ms", "seconds", "minutes"));

Meta