dfdatetime.DateTimeValues: modification time or None if not available.
767471
def modification_time(self):
    """"""
    timestamp = self._fsapfs_file_entry.get_modification_time_as_integer()
    return dfdatetime_apfs_time.APFSTime(timestamp=timestamp)
1221736
def get_modified_time(self) -> Optional[datetime.datetime]:
        
        stat_result = self._stat()
        # NOTE: Historically, this used stat_result[stat.ST_MTIME],
        # which truncates the fractional portion of the timestamp. It
        # was changed from that form to stat_result.st_mtime to
        # satisfy mypy (which disallows the bracket operator), but the
        # latter form returns a float instead of an int. For
        # consistency with the past (and because we have a unit test
        # that relies on this), we truncate the float here, although
        # I'm not sure that's the right thing to do.
        modified = datetime.datetime.utcfromtimestamp(int(stat_result.st_mtime))
        return modified
1039649
def _GetDateTime(self, filetime):
    
    if filetime == 0:
      return dfdatetime_semantic_time.SemanticTime('Not set')

    return dfdatetime_filetime.Filetime(timestamp=filetime)
1091059
def hold_time(self, datetime=None):
        

        def weights(x):
            if sum(x['amount']) != 0:
                return pd.Timestamp(self.datetime
                                   ) - pd.to_datetime(x.datetime.max())
            else:
                return np.nan

        if datetime is None:
            return self.history_table.set_index(
                'datetime',
                drop=False
            ).sort_index().groupby('code').apply(weights).dropna()
        else:
            return self.history_table.set_index(
                'datetime',
                drop=False
            ).sort_index().loc[:datetime].groupby('code').apply(weights
                                                               ).dropna()
1163058
def dateadd(value: fields.DateTime(),
            addend: fields.Int(validate=Range(min=1)),
            unit: fields.Str(validate=OneOf(['minutes', 'days']))='days'):
    """"""
    value = value or dt.datetime.utcnow()
    if unit == 'minutes':
        delta = dt.timedelta(minutes=addend)
    else:
        delta = dt.timedelta(days=addend)
    result = value + delta
    return {'result': result}
418355
def value_as_date(self):
        ''' 
        '''
        if self.value is None:
            return None
        v1, v2 = self.value
        if isinstance(v1, numbers.Number):
            dt = datetime.utcfromtimestamp(v1 / 1000)
            d1 = date(*dt.timetuple()[:3])
        else:
            d1 = v1
        if isinstance(v2, numbers.Number):
            dt = datetime.utcfromtimestamp(v2 / 1000)
            d2 = date(*dt.timetuple()[:3])
        else:
            d2 = v2
        return d1, d2
976297
def set(self, instance, value, **kw):
        
        if value:
            try:
                value = DateTime(value)
            except SyntaxError:
                logger.warn("Value '{}' is not a valid DateTime string"
                            .format(value))
                return False

        self._set(instance, value, **kw)
334457
def is_known_scalar(value):
    
    def _is_datetime_or_timedelta(value):
        # Using pandas.Series helps catch python, numpy and pandas
        # versions of these types
        return pd.Series(value).dtype.kind in ('M', 'm')

    return not np.iterable(value) and (isinstance(value, numbers.Number) or
                                       _is_datetime_or_timedelta(value))
442492
def pythonvaluetotime(time_val):
    ""
    if time_val is None:
        return None
    elif isinstance(time_val, numeric):
        return str(long(time_val * 1000.0))
    elif isinstance(time_val, date):
        dtlist = [time_val.year, time_val.month, time_val.day]
        if isinstance(time_val, datetime.datetime):
            dtlist += [time_val.hour, time_val.minute, time_val.second]
        else:
            dtlist += [0, 0, 0]
        return long(calendar.timegm(dtlist) * 1000.0)
    elif (isinstance(time_val, sequence)
                    and len(time_val) == 2):
        if all(isinstance(x, numeric) 
               for x in time_val):
            return ",".join(pythonvaluetotime(x) 
                            for x in time_val)
        elif all(isinstance(x, date) 
               for x in time_val):
            return ",".join(pythonvaluetotime(x) 
                            for x in time_val)
    raise ValueError(repr(time_val))
211199
def _wrap_results(result, dtype, fill_value=None):
    

    if is_datetime64_dtype(dtype) or is_datetime64tz_dtype(dtype):
        if fill_value is None:
            # GH#24293
            fill_value = iNaT
        if not isinstance(result, np.ndarray):
            tz = getattr(dtype, 'tz', None)
            assert not isna(fill_value), "Expected non-null fill_value"
            if result == fill_value:
                result = np.nan
            result = tslibs.Timestamp(result, tz=tz)
        else:
            result = result.view(dtype)
    elif is_timedelta64_dtype(dtype):
        if not isinstance(result, np.ndarray):
            if result == fill_value:
                result = np.nan

            # raise if we have a timedelta64[ns] which is too large
            if np.fabs(result) > _int64_max:
                raise ValueError("overflow in timedelta operation")

            result = tslibs.Timedelta(result, unit='ns')
        else:
            result = result.astype('i8').view(dtype)

    return result
318477
def updateColumnValue(self, column, value, index=None):
        
        if index is None:
            index = self.treeWidget().column(column.name())
        
        if type(value) == datetime.date:
            self.setData(index, Qt.EditRole, wrapVariant(value))
        elif type(value) == datetime.time:
            self.setData(index, Qt.EditRole, wrapVariant(value))
        elif type(value) == datetime.datetime:
            self.setData(index, Qt.EditRole, wrapVariant(value))
        elif type(value) in (float, int):
            if column.enum():
                self.setText(index, column.enum().displayText(value))
            else:
                self.setData(index, Qt.EditRole, wrapVariant(value))
        elif value is not None:
            self.setText(index, nativestring(value))
        else:
            self.setText(index, '')
        
        self.setSortData(index, value)
        
        # map default value information
        try:
            mapper = self.treeWidget().columnMappers().get(column.columnName())
        except AttributeError:
            mapper = None
        
        if mapper is None:
            form = column.stringFormat()
            if form:
                mapper = form.format
        
        if mapper:
            self.setText(index, mapper(value))
352506
def convert_datetime(value, parameter):
    '''
    
    '''
    value = _check_default(value, parameter, ( '', '-', None ))
    if value is None or isinstance(value, datetime.datetime):
        return value
    for fmt in settings.DATETIME_INPUT_FORMATS:
        try:
            return datetime.datetime.strptime(value, fmt)
        except (ValueError, TypeError):
            continue
    raise ValueError("`{}` does not match a format in settings.DATETIME_INPUT_FORMATS".format(value))
1190977
def modified(self):
        '''
        
        '''
        try:
            dt = datetime.datetime.fromtimestamp(self.stats.st_mtime)
            return dt.strftime('%Y.%m.%d %H:%M:%S')
        except OSError:
            return None
456475
def modification_time(self):
    """"""
    if self._zip_info is None:
      return None

    time_elements = getattr(self._zip_info, 'date_time', None)
    return dfdatetime_time_elements.TimeElements(time_elements)
721896
public static DateTime toDate(String str, boolean alsoNumbers, TimeZone tz, DateTime defaultValue) {
	return DateCaster.toDateAdvanced(str, alsoNumbers ? DateCaster.CONVERTING_TYPE_OFFSET : DateCaster.CONVERTING_TYPE_NONE, tz, defaultValue);
    }
1097151
def access_time(self):
    """"""
    if self._stat_info is None:
      return None

    timestamp = int(self._stat_info.st_atime)
    return dfdatetime_posix_time.PosixTime(timestamp=timestamp)
310842
public void specifyAmbiguousValues(JCas jcas) {
		// build up a list with all found TIMEX expressions
		List<Timex3> linearDates = new ArrayList<Timex3>();
		FSIterator iterTimex = jcas.getAnnotationIndex(Timex3.type).iterator();

		// Create List of all Timexes of types "date" and "time"
		while (iterTimex.hasNext()) {
			Timex3 timex = (Timex3) iterTimex.next();
			if (timex.getTimexType().equals("DATE") || timex.getTimexType().equals("TIME")) {
				linearDates.add(timex);
			}
			
			if(timex.getTimexType().equals("DURATION") && !timex.getEmptyValue().equals("")) {
				linearDates.add(timex);
			}
		}
		
		//////////////////////////////////////////////
		// go through list of Date and Time timexes //
		//////////////////////////////////////////////
		for (int i = 0; i < linearDates.size(); i++) {
			Timex3 t_i = (Timex3) linearDates.get(i);
			String value_i = t_i.getTimexValue();
			
			String valueNew = value_i;
			// handle the value attribute only if we have a TIME or DATE
			if(t_i.getTimexType().equals("TIME") || t_i.getTimexType().equals("DATE"))
					valueNew = specifyAmbiguousValuesString(value_i, t_i, i, linearDates, jcas);
			
			// handle the emptyValue attribute for any type
			if(t_i.getEmptyValue() != null && t_i.getEmptyValue().length() > 0) {
				String emptyValueNew = specifyAmbiguousValuesString(t_i.getEmptyValue(), t_i, i, linearDates, jcas);
				t_i.setEmptyValue(emptyValueNew);
			}
			
			t_i.removeFromIndexes();
			Logger.printDetail(t_i.getTimexId()+" DISAMBIGUATION PHASE: foundBy:"+t_i.getFoundByRule()+" text:"+t_i.getCoveredText()+" value:"+t_i.getTimexValue()+" NEW value:"+valueNew);
			
			t_i.setTimexValue(valueNew);
			t_i.addToIndexes();
			linearDates.set(i, t_i);
		}
	}