The OpenD Programming Language

Timestamp.toUnixTime

struct Timestamp
const @safe pure nothrow @nogc
long
toUnixTime
()

Examples

assert(Timestamp(1970, 1, 1).toUnixTime == 0);
assert(Timestamp(2007, 12, 22, 8, 14, 45).toUnixTime == 1_198_311_285);
assert(Timestamp(2007, 12, 22, 8, 14, 45).withOffset(90).toUnixTime == 1_198_311_285);
assert(Timestamp(1969, 12, 31, 23, 59, 59).toUnixTime == -1);

Meta