this < rhs | < 0 |
this == rhs | 0 |
this > rhs | > 0 |
DateTimeException if either of the given strings is not a valid time unit string.
import std.exception : assertThrown; assert(cmpTimeUnits("hours", "hours") == 0); assert(cmpTimeUnits("hours", "weeks") < 0); assert(cmpTimeUnits("months", "seconds") > 0); assertThrown!DateTimeException(cmpTimeUnits("month", "second"));
Compares two time unit strings. "years" are the largest units and "hnsecs" are the smallest.