function MonthFromTime(t) {
        var dwy = DayWithinYear(t);
        var leap = InLeapYear(t);
        if (dwy >= 0 && dwy < 31) {
            return 0;
        }
        if (dwy < 59 + leap) {
            return 1;
        }
        if (dwy < 90 + leap) {
            return 2;
        }
        if (dwy < 120 + leap) {
            return 3;
        }
        if (dwy < 151 + leap) {
            return 4;
        }
        if (dwy < 181 + leap) {
            return 5;
        }
        if (dwy < 212 + leap) {
            return 6;
        }
        if (dwy < 243 + leap) {
            return 7;
        }
        if (dwy < 273 + leap) {
            return 8;
        }
        if (dwy < 304 + leap) {
            return 9;
        }
        if (dwy < 334 + leap) {
            return 10;
        }
        if (dwy < 365 + leap) {
            return 11;
        }
        throw new Error('Invalid time');
    }
https://tc39.es/ecma262/#sec-month-number
@param t