Lines Matching refs:date
1 """Concrete date/time and related types.
7 __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo",
21 _MAXORDINAL = 3652059 # date.max.toordinal()
116 # the desired date. Now compute how many 100-year cycles precede n.
458 # tuple[int, int, int] -> tuple[int, int, int] version of date.fromisocalendar
893 class date:
894 """Concrete date type.
941 "a date object. "
959 "Construct a date from a POSIX timestamp (like time.time())."
965 "Construct a date from time.time()."
971 """Construct a date from a proleptic Gregorian ordinal.
981 """Construct a date from a string in ISO 8601 format."""
995 """Construct a date from the ISO year, week number and weekday.
997 This is the inverse of the date.isocalendar() function"""
1048 """Return the date formatted according to ISO.
1093 """Return a new date with new values for the specified fields."""
1102 # Comparisons of date objects with other.
1105 if isinstance(other, date):
1110 if isinstance(other, date):
1115 if isinstance(other, date):
1120 if isinstance(other, date):
1125 if isinstance(other, date):
1130 assert isinstance(other, date)
1144 "Add a date to a timedelta."
1155 """Subtract two dates, or a date and a timedelta."""
1158 if isinstance(other, date):
1216 _date_class = date # so functions w/ args named "date" can get at the class
1218 date.min = date(1, 1, 1)
1219 date.max = date(9999, 12, 31)
1220 date.resolution = timedelta(days=1)
1545 # is no ambiguity with date strings.
1555 """Format using strftime(). The date part of the timestamp passed
1669 class datetime(date):
1675 __slots__ = date.__slots__ + time.__slots__
1814 def combine(cls, date, time, tzinfo=True):
1815 "Construct a datetime from a given date and a given time."
1816 if not isinstance(date, _date_class):
1817 raise TypeError("date argument must be a date instance")
1822 return cls(date.year, date.month, date.day,
1922 def date(self):
1923 "Return the date part."
1924 return date(self._year, self._month, self._day)
2018 Optional argument sep specifies the separator between date and
2107 elif not isinstance(other, date):
2115 elif not isinstance(other, date):
2123 elif not isinstance(other, date):
2131 elif not isinstance(other, date):
2139 elif not isinstance(other, date):
2194 return type(self).combine(date.fromordinal(delta.days),