from-posix

xod/datetime/from-posix

Constructs a datetime value from a POSIX time format represented as 4 bytes.
from-posix
@/from-posix
Constructs a datetime value from a POSIX time format represented as 4 bytes.
B3byte
Most significant byte
B2byte
B1byte
B0byte
Least significant byte
from-posix
OUT
B3
B2
B1
B0
OUT@/datetime

C++ implementation

node {
    void evaluate(Context ctx) {
        uint32_t b3 = getValue<input_B3>(ctx);
        uint32_t b2 = getValue<input_B2>(ctx);
        uint32_t b1 = getValue<input_B1>(ctx);
        uint32_t b0 = getValue<input_B0>(ctx);
        uint32_t posix = ((b3 << 24) | (b2 << 16) | (b1 << 8) | b0);
        emitValue<output_OUT>(ctx, (typeof_OUT) posix);
    }
}