jstests/multiVersion/libs/data_generators.js
// Our ISODate constructor equals the Date BSON type
Our ISODate constructor equals the Date BSON type
Our ISODate constructor equals the Date BSON type
function GenISODate(seed) {
        var seed = seed || 0;
        var year = (seed % (2037 - 1970)) + 1970;
        var month = (seed % 12) + 1;
        var day = (seed % 27) + 1;
        var hour = seed % 24;
        var minute = seed % 60;
        var second = seed % 60;
        var millis = seed % 1000;
        function pad(number, length) {
            var str = '' + number;
            while (str.length < length) {
                str = '0' + str;
            }
            return str;
        }
        return ISODate(pad(year, 4) + "-" + pad(month, 2) + "-" + pad(day, 2) + "T" + pad(hour, 2) +
                       ":" + pad(minute, 2) + ":" + pad(second, 2) + "." + pad(millis, 3));
    }
function GenISODate ( seed ) { var seed = seed || 0 ; var year = ( seed % ( 2037 - 1970 ) ) + 1970 ; var month = ( seed % 12 ) + 1 ; var day = ( seed % 27 ) + 1 ; var hour = seed % 24 ; var minute = seed % 60 ; var second = seed % 60 ; var millis = seed % 1000 ; function pad ( number , length ) { var str = '' + number ; while ( str . length < length ) { str = '0' + str ; } return str ; } return ISODate ( pad ( year , 4 ) + "-" + pad ( month , 2 ) + "-" + pad ( day , 2 ) + "T" + pad ( hour , 2 ) + ":" + pad ( minute , 2 ) + ":" + pad ( second , 2 ) + "." + pad ( millis , 3 ) ) ; }
Our ISODate constructor equals the Date BSON type
Our ISODate constructor equals the Date BSON type