var.isDateTime

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

Check if this var holds a DateTime value.

More readable alternative to v.type == var.Type.DATETIME.

Returns

true if the value is a datetime (without timezone), false otherwise.

Examples

var dt = DateTime(2024, 6, 15, 14, 30, 0);
assert(dt.isDateTime);
var d = Date(2024, 6, 15);
assert(!d.isDateTime);