var.isSysTime

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

Check if this var holds a SysTime value.

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

Returns

true if the value is a timestamp with timezone, false otherwise.

Examples

import std.datetime.timezone : UTC;
var st = SysTime(DateTime(2024, 6, 15, 14, 30, 0), UTC());
assert(st.isSysTime);
var dt = DateTime(2024, 6, 15, 14, 30, 0);
assert(!dt.isSysTime);