Returns a new datetime.datetime or asn1crypto.util.extended_datetime
        object with the specified components replaced

        :return:
            A datetime.datetime or asn1crypto.util.extended_datetime object
172077
def replace(self, year=None, month=None, day=None, hour=None, minute=None,
                second=None, microsecond=None, tzinfo=None):
        

        if year is None:
            year = self.year
        if month is None:
            month = self.month
        if day is None:
            day = self.day
        if hour is None:
            hour = self.hour
        if minute is None:
            minute = self.minute
        if second is None:
            second = self.second
        if microsecond is None:
            microsecond = self.microsecond
        if tzinfo is None:
            tzinfo = self.tzinfo

        if year > 0:
            cls = datetime
        else:
            cls = extended_datetime

        return cls(
            year,
            month,
            day,
            hour,
            minute,
            second,
            microsecond,
            tzinfo
        )
1202678
def extract_exdates(component):
    
    dates = []

    exd_prop = component.get('exdate')
    if exd_prop:
        if isinstance(exd_prop, list): # In case there is more than one exdate property
            for exd_list in exd_prop:
                dates.extend(normalize(exd.dt) for exd in exd_list.dts)
        elif isinstance(exd_prop, vDDDLists):
            dates.extend(normalize(exd.dt) for exd in exd_prop.dts)

    return dates
1044474
def replace(self, **kwargs):
        
        return Date(kwargs.get("year", self.__year),
                    kwargs.get("month", self.__month),
                    kwargs.get("day", self.__day))
1242666
def add_seconds(self, datetimestr, n):
        
        a_datetime = self.parse_datetime(datetimestr)
        return a_datetime + timedelta(seconds=n)
1241123
def start_datetime(self) -> Optional[datetime.datetime]:
        
        if not self.intervals:
            return None
        return self.intervals[0].start
503249
def components(self):
        
        from pandas import DataFrame

        columns = ['days', 'hours', 'minutes', 'seconds',
                   'milliseconds', 'microseconds', 'nanoseconds']
        hasnans = self._hasnans
        if hasnans:
            def f(x):
                if isna(x):
                    return [np.nan] * len(columns)
                return x.components
        else:
            def f(x):
                return x.components

        result = DataFrame([f(x) for x in self], columns=columns)
        if not hasnans:
            result = result.astype('int64')
        return result
572303
def _new_DatetimeIndex(cls, d):
    

    if "data" in d and not isinstance(d["data"], DatetimeIndex):
        # Avoid need to verify integrity by calling simple_new directly
        data = d.pop("data")
        result = cls._simple_new(data, **d)
    else:
        with warnings.catch_warnings():
            # we ignore warnings from passing verify_integrity=False
            # TODO: If we knew what was going in to **d, we might be able to
            #  go through _simple_new instead
            warnings.simplefilter("ignore")
            result = cls.__new__(cls, verify_integrity=False, **d)

    return result
771483
def get_just_date(self):
        
        return datetime.datetime(
            self.date_time.year,
            self.date_time.month,
            self.date_time.day
        )
789439
def to_time(datetime, complete_date: :first, **opts)
			require 'time'
			return Time.now if datetime == :now
			begin
				fallback=Time.new(0) #supply the missing components
				return Time.parse(datetime,fallback)
			rescue ArgumentError
				year,month,day,time=split_date(datetime)
				case complete_date
				when :first
					month="01" if month == nil
					day="01" if day == nil
					time="00:00:00" if day == nil
				when :last
					month="12" if month == nil
					day=Months_end[month.to_i].to_s if day == nil
					time="23:59:59" if day == nil
				end
				return Time.parse("#{year}-#{month}-#{day}T#{time}",fallback)
			end
		end
1013365
def datetime(self):
        ''
        index = self.data.index.remove_unused_levels()
        return pd.to_datetime(index.levels[0])
649792
def date_to_datetime(d):
    
    if not isinstance(d, datetime):
        d = datetime.combine(d, datetime.min.time())
    return d
530177
def component(self, **kwargs):
        
        kwargs_copy = self.base_dict.copy()
        kwargs_copy.update(**kwargs)
        self._replace_none(kwargs_copy)        
        try:
            return NameFactory.component_format.format(**kwargs_copy)
        except KeyError:
            return None
732236
def _date_to_datetime(value):
  
  if not isinstance(value, datetime.date):
    raise TypeError('Cannot convert to datetime expected date value; '
                    'received %s' % value)
  return datetime.datetime(value.year, value.month, value.day)
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
116172
def to_datetime(time):
    ''''''
    if type(time) == IntType or type(time) == LongType:
        time = datetime.fromtimestamp(time // 1000)
    return time
125747
public static final <T extends Date> Function<T, DateTime> dateToDateTime(DateTimeZone dateTimeZone) {
		return new DateToDateTime<T>(dateTimeZone);
	}
1088772
def _past_datetime_from(self):
        
        prevDt = self.__localBefore(timezone.localtime(), dt.time.max,
                                    excludeCancellations=True,
                                    excludeExtraInfo=True)
        return prevDt