Custom date timestamp constructor. ditto
507246
def _dfromtimestamp(timestamp):
    
    try:
        return datetime.date.fromtimestamp(timestamp)
    except OSError:
        timestamp -= time.timezone
        d = datetime.date(1970, 1, 1) + datetime.timedelta(seconds=timestamp)
        if _isdst(d):
            timestamp += 3600
            d = datetime.date(1970, 1, 1) + datetime.timedelta(seconds=timestamp)
        return d
406485
def absdatetime(ts, default=None):
    """"""
    if ts is None:
        ts = default
    if isinstance(ts, dict):
        ts = timedelta(**ts)
    if isinstance(ts, timedelta):
        ts = now() + ts
    if isinstance(ts, datetime):
        return ts
    return None
1073479
def fill_from_timestamp(self, ts):
        
        dt = datetime.datetime.fromtimestamp(ts)
        self.wYear = dt.year
        self.wMonth = dt.month
        self.wDayOfWeek = dt.isoweekday() % 7 # :/
        self.wDay = dt.day
        self.wHour = dt.hour
        self.wMinute = dt.minute
        self.wSecond = dt.second
        self.wMilliseconds = dt.microsecond // 1000
897579
function timestamp(){

    var date = new Date();

    // Munge.
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    m = (m < 10 ? "0" : "") + m;
    var d = date.getDate();
    d = (d < 10 ? "0" : "") + d;
    var h = date.getHours();
    h = (h < 10 ? "0" : "") + h;
    var min = date.getMinutes();
    min = (min < 10 ? "0" : "") + m;
    var s = date.getSeconds();
    s = (s < 10 ? "0" : "") + s;

    // Assemble.
    return y +"-"+ m +"-"+ d + "T" + h + ":" + min + ":" + s;
}
228425
def timestamp(value):
    
    value = value if timezone.is_naive(value) else timezone.localtime(value)
    return value.strftime(settings.DATE_FORMAT)
45093
function (dp_inst) {
			var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val());

			this.timeDefined = this._parseTime(currDT);
			this._limitMinMaxDateTime(dp_inst, false);
			this._injectTimePicker();
			this._afterInject();
		}
320024
function timestamp() {
  var d = new Date();
  return d.getHours() + ':' + pad2(d.getMinutes()) + ':' + pad2(d.getSeconds());
}
370267
function timestamp (schema, options) {
  options || (options = {})

  // Options
  var fields = {}
    , createdPath = options.createdPath || 'created'
    , modifiedPath = options.modifiedPath || 'modified'
    , useVirtual = (options.useVirtual !== undefined) 
      ? options.useVirtual 
      : true

  // Add paths to schema if not present
  if (!schema.paths[createdPath]) {
    fields[modifiedPath] = { type: Date }
  }
  if (useVirtual) {
    // Use the ObjectID for extracting the created time
    schema.virtual(createdPath).get(function () {
      return new Date(this._id.generationTime * 1000)
    })
  } else {
    if (!schema.paths[createdPath]) {
      fields[createdPath] = { 
        type: Date
      , default: Date.now 
      }
    }
  }
  schema.add(fields)

  // Update the modified timestamp on save
  schema.pre('save', function (next) {
    this[modifiedPath] = new Date
    next()
  })
}
1310398
function (timeString, withDate) {
			if (!this.inst) {
				this.inst = $.datepicker._getInst(this.$input[0]);
			}

			if (withDate || !this._defaults.timeOnly) {
				var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
				try {
					var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
					if (!parseRes.timeObj) {
						return false;
					}
					$.extend(this, parseRes.timeObj);
				} catch (err) {
					$.timepicker.log("Error parsing the date/time string: " + err +
									"\ndate/time string = " + timeString +
									"\ntimeFormat = " + this._defaults.timeFormat +
									"\ndateFormat = " + dp_dateFormat);
					return false;
				}
				return true;
			} else {
				var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
				if (!timeObj) {
					return false;
				}
				$.extend(this, timeObj);
				return true;
			}
		}
598525
def SetUpperTimestamp(cls, timestamp):
    """"""
    if not hasattr(cls, '_upper'):
      cls._upper = timestamp
      return

    if timestamp > cls._upper:
      cls._upper = timestamp
237587
def certify_date(value, required=True):
    
    if certify_required(
        value=value,
        required=required,
    ):
        return

    if not isinstance(value, date):
        raise CertifierTypeError(
            message="expected timestamp (date∂), but value is of type {cls!r}".format(
                cls=value.__class__.__name__),
            value=value,
            required=required,
        )
266050
def timestamp(self, timestamp):
        """"""
        if timestamp is None:
            self._timestamp = datetime.utcnow()
        elif isinstance(timestamp, datetime):
            self._timestamp = timestamp
        else:
            self._timestamp = datetime.strptime(timestamp, fmt)
93613
def tai_timestamp():
    """"""
    timestamp = time.time()
    date = datetime.utcfromtimestamp(timestamp)
    if date.year < 1972:
        return timestamp
    offset = 10 + timestamp
    leap_seconds = [
        (1972, 1, 1),
        (1972, 7, 1),
        (1973, 1, 1),
        (1974, 1, 1),
        (1975, 1, 1),
        (1976, 1, 1),
        (1977, 1, 1),
        (1978, 1, 1),
        (1979, 1, 1),
        (1980, 1, 1),
        (1981, 7, 1),
        (1982, 7, 1),
        (1983, 7, 1),
        (1985, 7, 1),
        (1988, 1, 1),
        (1990, 1, 1),
        (1991, 1, 1),
        (1992, 7, 1),
        (1993, 7, 1),
        (1994, 7, 1),
        (1996, 1, 1),
        (1997, 7, 1),
        (1999, 1, 1),
        (2006, 1, 1),
        (2009, 1, 1),
        (2012, 7, 1),
        (2015, 7, 1),
        (2017, 1, 1),
    ]
    for idx, leap_date in enumerate(leap_seconds):
        if leap_date >= (date.year, date.month, date.day):
            return idx - 1 + offset
    return len(leap_seconds) - 1 + offset
891017
function(type, args, obj) {
        var val = args[0];
        if (Lang.isString(val)) {
            val = this._parseDate(val);
            this.cfg.setProperty(DEF_CFG.MINDATE.key, DateMath.getDate(val[0],(val[1]-1),val[2]));
        }
    }
904760
def parse_timestamp(x):
    """"""
    dt = dateutil.parser.parse(x)
    if dt.tzinfo is None:
        dt = dt.replace(tzinfo=pytz.utc)
    return dt
1272497
function _timestampBeforeNow(timestamp) {
      if(!(typeof timestamp === 'string' && dateRegEx.test(timestamp))) {
        throw new TypeError('`revoked` timestamp must be a string.');
      }
      const now = new Date();
      const tsDate = new Date(timestamp);
      return tsDate < now;
    }
1348911
function setTimeMethods() {
	var useUTC = defaultOptions.global.useUTC;

	makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {
		return new Date(
			year,
			month,
			pick(date, 1),
			pick(hours, 0),
			pick(minutes, 0),
			pick(seconds, 0)
		).getTime();
	};
	getMinutes = useUTC ? 'getUTCMinutes' : 'getMinutes';
	getHours = useUTC ? 'getUTCHours' : 'getHours';
	getDay = useUTC ? 'getUTCDay' : 'getDay';
	getDate = useUTC ? 'getUTCDate' : 'getDate';
	getMonth = useUTC ? 'getUTCMonth' : 'getMonth';
	getFullYear = useUTC ? 'getUTCFullYear' : 'getFullYear';
	setMinutes = useUTC ? 'setUTCMinutes' : 'setMinutes';
	setHours = useUTC ? 'setUTCHours' : 'setHours';
	setDate = useUTC ? 'setUTCDate' : 'setDate';
	setMonth = useUTC ? 'setUTCMonth' : 'setMonth';
	setFullYear = useUTC ? 'setUTCFullYear' : 'setFullYear';

}