var.isTemporal

bool isTemporal() @property const nothrow @nogc pure @safe

Check if this var holds any temporal (datetime) type.

Convenience method to check for any of: Date, TimeOfDay, DateTime, SysTime, or Duration.

Returns

true if the value is any temporal type, false otherwise.

Examples

var d = Date(2024, 6, 15);
assert(d.isTemporal);
import core.time : minutes;
var dur = minutes(30);
assert(dur.isTemporal);
var i = 42;
assert(!i.isTemporal);