class MDateAndTime {

    public static long[] parseDateTime(long val) {
        if((val != 0) && (val <= 100)) {
            throw new InvalidDateFormatException("date", Long.toString(val));
        }
        // Pad out HHMMSS if needed
        if(val < DATETIME_MONTH_SCALE) {
            val *= DATETIME_DATE_SCALE;
        }
        // External is same as internal, though a two-digit year may need converted
        long[] dt = decodeDateTime(val);
        if(val != 0) {
            dt[YEAR_INDEX] = adjustTwoDigitYear(dt[YEAR_INDEX]);
        }
        if(!isValidDateTime_Zeros(dt)) {
            throw new InvalidDateFormatException("date", Long.toString(val));
        }
        if(!isValidHrMinSec(dt, true, true)) {
            throw new InvalidDateFormatException("datetime", Long.toString(val));
        }
        return dt;
    }

}