myunpack-datetime

sergtzar67/program-clock-v01/myunpack-datetime

No description
myunpack-datetime
@/myunpack-datetime
INnumber
myunpack-datetime
IN
HOUR
MIN
SEC
SECnumber
MINnumber
HOURnumber
To use the node in your project you should have the sergtzar67/program-clock-v01 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    uint32_t time = getValue<input_IN>(ctx);

    emitValue<output_SEC>(ctx, time % 60);
    time /= 60;
    emitValue<output_MIN>(ctx, time % 60);
    time /= 60;
    emitValue<output_HOUR>(ctx, time % 24);
    time /= 24;
}