public static LocalDateTime s7DateTimeToLocalDateTime(ByteBuf data) {
        //from Plc4XS7Protocol
        int year = bcdToInt(data.readByte());
        int month = bcdToInt(data.readByte());
        int day = bcdToInt(data.readByte());
        int hour = bcdToInt(data.readByte());
        int minute = bcdToInt(data.readByte());
        int second = bcdToInt(data.readByte());
        int millih = bcdToInt(data.readByte()) * 10;

        int milll = (data.readByte() >> 4);

        int milliseconds = millih + milll;
        int nanoseconds = milliseconds * 1000000;
        //At this point a dont need the day of week
        //data-type ranges from 1990 up to 2089
        if (year >= 90) {
            year += 1900;
        } else {
            year += 2000;
        }

        return LocalDateTime.of(year, month, day, hour, minute, second, nanoseconds);
    }
converts incoming Short to an integer regarding used BCD format

@param incomingShort the incoming byte
@return converted BCD number
plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java