needs to have 7 arguments to be compliant to length of Date constructor
350266
function FakeDate(a, b, c, d, e, f, g) {
    var argsArray = [].splice.call(arguments, 0);
    var date =
      argsArray.length === 0
        ? new OriginalDate(Date.now())
        : makeOriginalDateFromArgs.apply(undefined, argsArray);

    if (!(this instanceof FakeDate)) {
      return date.toString();
    }

    this._date = date;
  }
761293
function(arg) {
  var args = Array.isArray(arg) ? arg : Array.apply(null, arguments);
  lastMsgDate = new Date();
  fs.write(tempFile, JSON.stringify(args) + '\n', 'a');
}
755741
function addDayToRange(day) {
  var range = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { from: null, to: null };
  var from = range.from,
      to = range.to;

  if (!from) {
    from = day;
  } else if (from && to && isSameDay(from, to) && isSameDay(day, from)) {
    from = null;
    to = null;
  } else if (to && isDayBefore(day, from)) {
    from = day;
  } else if (to && isSameDay(day, to)) {
    from = day;
    to = day;
  } else {
    to = day;
    if (isDayBefore(to, from)) {
      to = from;
      from = day;
    }
  }

  return { from: from, to: to };
}
638337
function (json, callback) {
        //validate input
        if (!inputValidation(json)) {
            var inputError = new SearchError('invalid input');
            callback(undefined, inputError);
            return;
        }
        //make end date last millisecond of the day
        var end = new Date(json.date);
        end.setHours(23);
        end.setMinutes(59);
        end.setSeconds(59);
        end.setMilliseconds(999);
        end = end.toISOString();
        //ensure start date is at 00:00:000
        var start = new Date(json.date);
        start.setHours(0);
        start.setMinutes(0);
        start.setSeconds(0);
        start.setMilliseconds(0);
        start = start.toISOString();

        database.getSentimentForNameTimeframe(json.character, start, end, function (json, err) {
            if (err) {
                callback(undefined, err);
            } else {
                var result = {};
                var posSentDaily = 0;
                var negSentDaily = 0;
                var posDaily = 0;
                var negDaily = 0;
                var nullDaily = 0;
                for (var i in json) {
                    posSentDaily += json[i].posSum;
                    negSentDaily += json[i].negSum;
                    posDaily += json[i].posCount;
                    negDaily += json[i].negCount;
                    nullDaily += json[i].nullCount;
                }
                result.character = json[0].character;
                result.description = json[0].description;
                result.posSum = posSentDaily;
                result.negSum = negSentDaily;
                result.posCount = posDaily;
                result.negCount = negDaily;
                result.nullCount = nullDaily;
                result.date = start;
                callback(result);
            }
        });
    }
1076667
function (event) {
      switch (attribute.type) {
        case 'Date':
          attribute.value = (input.value === '') ? null : attribute.coerce(input.value);
          if (attribute.value != null) {
            var mm = attribute.value.getMonth() + 1;
            var dd = attribute.value.getDate();
            var yyyy = attribute.value.getFullYear();
            if (mm < 10) mm = '0' + mm;
            if (dd < 10) dd = '0' + dd;
            input.value = mm + '/' + dd + '/' + yyyy;
          } else {
            input.value = '';
          }
          break;
        default:
          attribute.value = (input.value === '') ? null : attribute.coerce(input.value);
          if (attribute.value != null)
            input.value = attribute.value;
          break;
      }
      attribute.validate(function () {
      });
    }
57917
function(inst, date, defaultDate) {
		var offsetNumeric = function(offset) {
				var date = new Date();
				date.setDate(date.getDate() + offset);
				return date;
			},
			offsetString = function(offset) {
				try {
					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
						offset, $.datepicker._getFormatConfig(inst));
				}
				catch (e) {
					// Ignore
				}

				var date = (offset.toLowerCase().match(/^c/) ?
					$.datepicker._getDate(inst) : null) || new Date(),
					year = date.getFullYear(),
					month = date.getMonth(),
					day = date.getDate(),
					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
					matches = pattern.exec(offset);

				while (matches) {
					switch (matches[2] || "d") {
						case "d" : case "D" :
							day += parseInt(matches[1],10); break;
						case "w" : case "W" :
							day += parseInt(matches[1],10) * 7; break;
						case "m" : case "M" :
							month += parseInt(matches[1],10);
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
							break;
						case "y": case "Y" :
							year += parseInt(matches[1],10);
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
							break;
					}
					matches = pattern.exec(offset);
				}
				return new Date(year, month, day);
			},
			newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
				(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));

		newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
		if (newDate) {
			newDate.setHours(0);
			newDate.setMinutes(0);
			newDate.setSeconds(0);
			newDate.setMilliseconds(0);
		}
		return this._daylightSavingAdjust(newDate);
	}
782411
function(identifier, typemap, args, error) {
		var bufArray = [ new Buffer([ module.exports.EnumExecutionCode.ExecFunction ]) ];
		bufArray.push(new Buffer(4)); // [1] = reserverd for total payload size, minus the execution code
		
		var buf = new Buffer(4);
		buf.writeUInt32LE(identifier.length);
		bufArray.push(buf);
		
		var tempBuf = new Buffer(identifier);
		bufArray.push(tempBuf);
		
		var payloadLength = 4 + identifier.length;
		for(var i = 0; i < args.length; i++) {
			var iStr = i.toString();
			var argtype = typemap[iStr];
			
			if(!argtype) {
				if(args[i] === null) {
					argtype = 'null';
				}
				else {
					switch(typeof args[i]) {
						case 'number':
							if(args[i] === (args[i]|0)) {
								argtype = 'int'; // Default to int for normal numbers
							}
							else {
								argtype = 'float'; // float for anything else
							}
							break;
						case 'string':
							argtype = 'string';
							break;
						case 'boolean':
							argtype = 'boolean';
							break;
						case 'undefined':
							argtype = 'undefined';
							break;
					}
				}
				typemap[iStr] = argtype;
			}
			
			var dataType = module.exports.EnumDataType[argtype];
			if(dataType !== undefined) {
				switch(dataType) {
					case module.exports.EnumDataType.byte:
						tempBuf = new Buffer(1);
						tempBuf.writeInt8(args[i], 0);
						break;
					case module.exports.EnumDataType.ubyte:
						tempBuf = new Buffer(1);
						tempBuf.writeUInt8(args[i], 0);
						break;
					case module.exports.EnumDataType.short:
						tempBuf = new Buffer(2);
						tempBuf.writeInt16LE(args[i], 0);
						break;
					case module.exports.EnumDataType.ushort:
						tempBuf = new Buffer(2);
						tempBuf.writeUInt16LE(args[i], 0);
						break;
					case module.exports.EnumDataType.int:
						tempBuf = new Buffer(4);
						tempBuf.writeInt32LE(args[i], 0);
						break;
					case module.exports.EnumDataType.uint:
						tempBuf = new Buffer(4);
						tempBuf.writeUInt32LE(args[i], 0);
						break;
					case module.exports.EnumDataType.float:
						tempBuf = new Buffer(4);
						tempBuf.writeFloatLE(args[i], 0);
						break;
					case module.exports.EnumDataType.double:
						tempBuf = new Buffer(8);
						tempBuf.writeDoubleLE(args[i], 0);
						break;
					case module.exports.EnumDataType.string:
						tempBuf = new Buffer(args[i]);
						break;
					case module.exports.EnumDataType.boolean:
						tempBuf = new Buffer(1);
						tempBuf.writeUInt8(args[i] ? 0x1 : 0x0, 0);
						break;
					case module.exports.EnumDataType.undefined:
					case module.exports.EnumDataType.null:
						tempBuf = new Buffer(0);
						break;
					default:
						error(new Error('Data type ' + dataType + ' has gone unhandled by client'));
						return;
				}
				var argHeader = new Buffer(5);
				argHeader.writeUInt8(dataType, 0);
				argHeader.writeUInt32LE(tempBuf.length, 1);
				bufArray.push(argHeader);
				bufArray.push(tempBuf);
				
				payloadLength += argHeader.length + tempBuf.length;
			}
			else {
				error(new Error('Unsupported data type argument passed to remote function'));
				return;
			}
		}
		
		bufArray[1].writeUInt32LE(payloadLength);
		
		return Buffer.concat(bufArray);
	}
804995
def QA_util_date_int2str(int_date):
    
    date = str(int_date)
    if len(date) == 8:
        return str(date[0:4] + '-' + date[4:6] + '-' + date[6:8])
    elif len(date) == 10:
        return date
958827
public static long calc(Date arg0, Date arg1, DateUnit dateUnit) {
        return calc(arg0.toInstant(), arg1.toInstant(), dateUnit);
    }
1277489
function parse_date_strings(root) {
    for (key in root) {
        if (!root.hasOwnProperty(key)) continue;
        var value = root[key];
        if (typeof(value) === 'object') { 
            parse_date_strings(value);
        } else if (typeof(value) === 'string' && /\d{4}-?\d{2}-?\d{2}(T?\d{2}:?\d{2}:?\d{2}(Z)?)?/.test(value)) {
            var timestamp = Date.parse(value);
            if (!isNaN(timestamp)) {
                root[key] = new Date(timestamp);
            }
        }
    }
}
266608
protected Date massageDate (Object arg)
    {
        if (arg instanceof Long) {
            return new Date(((Long)arg).longValue());
        } else if (arg instanceof Date) {
            return (Date)arg;
        } else if (arg instanceof Calendar) {
            return ((Calendar)arg).getTime();
        } else {
            System.err.println("Date provided with invalid argument " +
                               "[arg=" + arg + ", aclass=" +
                               StringUtil.shortClassName(arg) + "].");
            return null;
        }
    }
1275772
public static void validDate(Long pContent, String pParamName) throws APPErrorException {
        if(null==pContent||pContent.longValue()<minDate)
        {
            throw new APPErrorException(pParamName + " 错误的时间值");
        }
    }
94461
function buildDatePartial() {
        if (self.sDateColumnName && self.dateFrom || self.dateTo) {
            // console.log( "DateFrom %s to %s", self.dateFrom, self.dateTo );
            if (self.dateFrom && self.dateTo) {
                return self.sDateColumnName + " BETWEEN '" + self.dateFrom.toISOString() + "' AND '" + self.dateTo.toISOString() + "'";
            } else if (self.dateFrom) {
                return self.sDateColumnName + " >= '" + self.dateFrom.toISOString() + "'";
            } else if (self.dateTo) {
                return self.sDateColumnName + " <= '" + self.dateTo.toISOString() + "'";
            }
        }
        return undefined;
    }
326503
public void init(String strDateParam, Date dateTarget, String strLanguage)
    {
        if (strDateParam == null)
            strDateParam = JCalendarPopup.DATE_PARAM;
        dateParam = strDateParam; 
        targetDate = dateTarget;
        languageString = strLanguage;
    }
1104910
function collectUpdateDateArguments(args, allowDuration) {
  var arg1 = args[0], arg2 = args[1], params, reset;
  if (allowDuration && isString(arg1)) {
    params = getDateParamsFromString(arg1);
    reset  = arg2;
  } else if (isNumber(arg1) && isNumber(arg2)) {
    params = collectDateParamsFromArguments(args);
  } else {
    params = isObjectType(arg1) ? simpleClone(arg1) : arg1;
    reset  = arg2;
  }
  return [params, reset];
}
1007896
function dateList(numbers, type) {
    if (numbers.length < 2) {
      return numberToDateName('' + numbers[0], type);
    }

    var lastVal = '' + numbers.pop();
    var outputText = '';

    for (var i = 0, value; value = numbers[i]; i++) {
      if (outputText.length > 0) {
        outputText += ', ';
      }
      outputText += numberToDateName(value, type);
    }
    return outputText + ` ${locale['and']} ` + numberToDateName(lastVal, type);
  }
246115
function Datepicker(el, options) {
      _classCallCheck(this, Datepicker);

      var _this27 = _possibleConstructorReturn(this, (Datepicker.__proto__ || Object.getPrototypeOf(Datepicker)).call(this, Datepicker, el, options));

      _this27.el.M_Datepicker = _this27;

      _this27.options = $.extend({}, Datepicker.defaults, options);

      // Remove time component from minDate and maxDate options
      if (_this27.options.minDate) _this27.options.minDate.setHours(0, 0, 0, 0);
      if (_this27.options.maxDate) _this27.options.maxDate.setHours(0, 0, 0, 0);

      _this27.id = M.guid();

      _this27._setupVariables();
      _this27._insertHTMLIntoDOM();
      _this27._setupModal();

      _this27._setupEventHandlers();

      if (!_this27.options.defaultDate) {
        _this27.options.defaultDate = new Date(Date.parse(_this27.el.value));
        _this27.options.setDefaultDate = true;
      }

      var defDate = _this27.options.defaultDate;

      if (Datepicker._isDate(defDate)) {
        if (_this27.options.setDefaultDate) {
          _this27.setDate(defDate, true);
        } else {
          _this27.gotoDate(defDate);
        }
      } else {
        _this27.gotoDate(new Date());
      }

      /**
       * Describes open/close state of datepicker
       * @type {Boolean}
       */
      _this27.isOpen = false;

      return _this27;
    }