Generating time and dates is very similar so we route both to this single function
335312
function getDate (type, min, max, format, options) {
  var ret;

  // Juggle the arguments if the user didn't supply a format string
  if (!options) {
    options = format;
    format = null;
  }

  if (type === 'date') {
    min = Date.parse(min);
    max = Date.parse(max);
  } else if (type === 'time') {
    min = Date.parse('1970-01-01T' + min);
    max = Date.parse('1970-01-01T' + max);
  }

  ret = utils.randomDate(min, max);

  if (format === 'unix') {
    // We need to undo the timezone offset fix from utils.randomDate()
    ret = Math.floor((ret.getTime() - ret.getTimezoneOffset() * 60000) / 1000);
  } else if (format) {
    ret = fecha.format(ret, format);
  } else if (type === 'time') {
    // Time has a default format if one is not specified
    ret = fecha.format(ret, 'HH:mm');
  }

  return ret;
}
726862
function createDateTimeFormatter( type, inputFormat ) {
   return ( options, value ) => {
      if( value == null ) {
         return '';
      }

      if( value instanceof Date ) {
         return format( moment( value ) );
      }

      if( typeof value !== 'string' ) {
         throw argumentError( value );
      }

      const useInputFormat = value.length < ISO_FULL_FORMAT_MIN_LENGTH;
      const momentTime = value.toLowerCase() === 'now' ?
         moment() :
         moment( value, useInputFormat ? inputFormat : undefined, useInputFormat || undefined );

      if( !momentTime.isValid() ) {
         throw argumentError( value );
      }

      return format( momentTime );

      ////////////////////////////////////////////////////////////////////////////////////////////////////////

      function format( momentTime ) {
         return momentTime.format( options[ `${type}Format` ] );
      }

      function argumentError( value ) {
         return new TypeError(
            'Expected argument to be a Date object, the string "NOW", or an ISO-8601 string ' +
            `(full, or ${type} as ${inputFormat}), but got "${typeof value}". Value: ${value}`
         );
      }
   };
}
1001046
function CronDate (date) {
		this.milliseconds = date.getMilliseconds();
		this.seconds = date.getSeconds() + 1;
		this.minutes = date.getMinutes();
		this.hours = date.getHours();
		this.days = date.getDate();
		this.months  = date.getMonth();
		this.years = date.getFullYear();
	}
654804
function dateGenerator(ts, opts) {
		if (opts.timezone == "browser") {
			return new Date(ts);
		} else if (!opts.timezone || opts.timezone == "utc") {
			return makeUtcWrapper(new Date(ts));
		} else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") {
			var d = new timezoneJS.Date();
			// timezone-js is fickle, so be sure to set the time zone before
			// setting the time.
			d.setTimezone(opts.timezone);
			d.setTime(ts);
			return d;
		} else {
			return makeUtcWrapper(new Date(ts));
		}
	}
995593
function time( start, end ) {
	var arr;
	var i;

	// Convert start and end times to JavaScript timestamps..
	start = ( new Date( start ) ).getTime();
	end = ( new Date( end ) ).getTime();

	// Add <1 day to ensure end time is included in time vector:
	end += 43200000; // half day [ms]

	// Create a linearly spaced date vector:
	arr = incrdatespace( start, end, 'day' );

	// Convert all date objects to JavaScript timestamps...
	for ( i = 0; i < arr.length; i++ ) {
		arr[ i ] = arr[ i ].getTime();
	}
	return arr;
}
367981
def method_missing(sym, *args, &block)
      result = time.__send__(sym, *args, &block)
      result.acts_like?(:time) ? self.class.new(nil, time_zone, result) : result
    end
1313385
function timeMatch(value, cronTime){
  if(typeof(cronTime) == 'number'){
    if(cronTime == -1)
      return true;
    if(value == cronTime)
      return true;
    return false;
  }else if(typeof(cronTime) == 'object' && cronTime instanceof Array){
    if(value < cronTime[0] || value > cronTime[cronTime.length -1])
      return false;

    for(let i = 0; i < cronTime.length; i++)
      if(value == cronTime[i])
        return true;

    return false;
  }

  return null;
}
1219806
function (startTime, endTime, callback) {
    var self = this;

    self._request({
      path: urlJoin(_urlPrefix, 'usage'),
      qs: {
        startTime: typeof startTime === 'Date' ? startTime.toISOString() : startTime,
        endTime: typeof endTime === 'Date' ? endTime.toISOString() : endTime
      }
    }, function (err, body) {
      return callback(err, body);
    });
  }
977764
function dateEqual(a, b) {
  if ('date' !== type(b)) return false;
  return sameValue(a.getTime(), b.getTime());
}
866187
function() {
        var _date = {
            year: 			0,
            month: 			1, // stupid JS dates
            day: 			1,
            hour: 			0,
            minute: 		0,
            second: 		0,
            millisecond: 	0
		};

		// Merge data
		TL.Util.mergeData(_date, this.data);

 		// Make strings into numbers
		var DATE_PARTS = TL.Date.DATE_PARTS;

 		for (var ix in DATE_PARTS) {
 		    var x = TL.Util.trim(_date[DATE_PARTS[ix]]);
 		    if (!x.match(/^-?\d*$/)) {
 		        throw new TL.Error("invalid_date_err", DATE_PARTS[ix] + " = '" + _date[DATE_PARTS[ix]] + "'");
 		    }
 		    
			var parsed = parseInt(_date[DATE_PARTS[ix]]);
			if (isNaN(parsed)) {
                parsed = (ix == 4 || ix == 5) ? 1 : 0; // month and day have diff baselines
            }
			_date[DATE_PARTS[ix]] = parsed;
		}

		if (_date.month > 0 && _date.month <= 12) { // adjust for JS's weirdness
			_date.month = _date.month - 1;
		}

		return _date;
    }
985651
function(mongoDate) {
	//console.log(mongoDate);
	var jsDate = new Date(mongoDate);
	var d = zeroPad(jsDate.getDate(),2);
	var m = zeroPad(jsDate.getMonth()+1,2);
	var y = jsDate.getFullYear();
	var h = zeroPad(jsDate.getHours(),2);
	var mn = zeroPad(jsDate.getMinutes(),2);
	var s = zeroPad(jsDate.getSeconds(),2);
	var pickerDate = y+'-'+m+'-'+d+'T'+h+':'+mn+':'+s;
	//console.log(pickerDate);
	return pickerDate;
}
569720
private ChronoUnit toChronoUnit(TimeUnit timeUnit) {
    switch (timeUnit) {
      case NANOSECONDS:
        return ChronoUnit.NANOS;
      case MICROSECONDS:
        return ChronoUnit.MICROS;
      case MILLISECONDS:
        return ChronoUnit.MILLIS;
      case SECONDS:
        return ChronoUnit.SECONDS;
      case MINUTES:
        return ChronoUnit.MINUTES;
      case HOURS:
        return ChronoUnit.HOURS;
      case DAYS:
        return ChronoUnit.DAYS;
      default:
        throw new IllegalArgumentException("No ChronoUnit equivalent for " + timeUnit);
    }
  }
314247
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
    return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
}
741648
def _build_time(time, kwargs):
    
    tz = kwargs.pop('tz', 'UTC')
    if time:
        if kwargs:
            raise ValueError('Cannot pass kwargs and a time')
        else:
            return ensure_utc(time, tz)
    elif not kwargs:
        raise ValueError('Must pass a time or kwargs')
    else:
        return datetime.time(**kwargs)
287512
function (o) {
			o = o || {};
			var tmp_args = arguments;

			if (typeof(o) === 'string') {
				if (o === 'getDate'  || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) {
					return $.fn.datepicker.apply($(this[0]), tmp_args);
				} else {
					return this.each(function () {
						var $t = $(this);
						$t.datepicker.apply($t, tmp_args);
					});
				}
			} else {
				return this.each(function () {
					var $t = $(this);
					$t.datepicker($.timepicker._newInst($t, o)._defaults);
				});
			}
		}
1152690
def _join_date_and_time(dates, times, joiner):
  
  return tuple("{}{}{}".format(d, joiner, t) for (d, t) in itertools.product(dates, times))
141316
function makeUtcWrapper(d) {

		function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {
			sourceObj[sourceMethod] = function() {
				return targetObj[targetMethod].apply(targetObj, arguments);
			};
		};

		var utc = {
			date: d
		};

		// support strftime, if found

		if (d.strftime != undefined) {
			addProxyMethod(utc, "strftime", d, "strftime");
		}

		addProxyMethod(utc, "getTime", d, "getTime");
		addProxyMethod(utc, "setTime", d, "setTime");

		var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"];

		for (var p = 0; p < props.length; p++) {
			addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]);
			addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]);
		}

		return utc;
	}