ezQbdZddlmZmZmZmZmZddlmZmZddlm Z GddeZ Gdde Z Gd d eZ Gd d e Z Gd deZGdde eZGddeZGddeZGddeZe ee e ee e eee eee eey)zDatetime interfaces. This module is called idatetime because if it were called datetime the import of the real datetime would fail. ) timedeltadatedatetimetimetzinfo) Interface Attribute)classImplementsc@eZdZdZedZedZedZy)ITimeDeltaClasszThis is the timedelta class interface. This is symbolic; this module does **not** make `datetime.timedelta` provide this interface. z"The most negative timedelta objectz"The most positive timedelta objectz;The smallest difference between non-equal timedelta objectsN__name__ __module__ __qualname____doc__r minmax resolutionA/usr/lib/python3/dist-packages/zope/interface/common/idatetime.pyr r s- 8 9C 8 9CEGJrr c@eZdZdZedZedZedZy) ITimeDeltaaRepresent the difference between two datetime objects. Implemented by `datetime.timedelta`. Supported operators: - add, subtract timedelta - unary plus, minus, abs - compare to timedelta - multiply, divide by int/long In addition, `.datetime` supports subtraction of two `.datetime` objects returning a `.timedelta`, and addition or subtraction of a `.datetime` and a `.timedelta` giving a `.datetime`. Representation: (days, seconds, microseconds). z/Days between -999999999 and 999999999 inclusivez%Seconds between 0 and 86399 inclusivez+Microseconds between 0 and 999999 inclusiveN)rrrrr daysseconds microsecondsrrrrr&s*$ F GD?@GJKLrrcReZdZdZedZedZedZdZdZ dZ y) IDateClasszThis is the date class interface. This is symbolic; this module does **not** make `datetime.date` provide this interface. zThe earliest representable datezThe latest representable datez6The smallest difference between non-equal date objectscy)zaReturn the current local time. This is equivalent to ``date.fromtimestamp(time.time())``NrrrrtodayzIDateClass.todayNrcy)aReturn the local date from a POSIX timestamp (like time.time()) This may raise `ValueError`, if the timestamp is out of the range of values supported by the platform C ``localtime()`` function. It's common for this to be restricted to years from 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by `fromtimestamp`. Nr timestamps r fromtimestampzIDateClass.fromtimestampSr!rcy)a Return the date corresponding to the proleptic Gregorian ordinal. January 1 of year 1 has ordinal 1. `ValueError` is raised unless 1 <= ordinal <= date.max.toordinal(). For any date *d*, ``date.fromordinal(d.toordinal()) == d``. Nrordinals r fromordinalzIDateClass.fromordinal]r!rN) rrrrr rrrr r%r)rrrrr@s= 5 6C 3 4C@BJE   rrc|eZdZdZedZedZedZdZdZ dZ dZ d Z d Z d Zd Zd ZdZy)IDatezRepresents a date (year, month and day) in an idealized calendar. Implemented by `datetime.date`. Operators: __repr__, __str__ __cmp__, __hash__ __add__, __radd__, __sub__ (add/radd only with timedelta arg) z&Between MINYEAR and MAXYEAR inclusive.zBetween 1 and 12 inclusivezFBetween 1 and the number of days in the given month of the given year.cy)zReturn a date with the same value. Except for those members given new values by whichever keyword arguments are specified. For example, if ``d == date(2002, 12, 31)``, then ``d.replace(day=26) == date(2000, 12, 26)``. Nr)yearmonthdays rreplacez IDate.replacezr!rcy)a8Return a 9-element tuple of the form returned by `time.localtime`. The hours, minutes and seconds are 0, and the DST flag is -1. ``d.timetuple()`` is equivalent to ``(d.year, d.month, d.day, 0, 0, 0, d.weekday(), d.toordinal() - date(d.year, 1, 1).toordinal() + 1, -1)`` Nrrrr timetuplezIDate.timetupler!rcy)zReturn the proleptic Gregorian ordinal of the date January 1 of year 1 has ordinal 1. For any date object *d*, ``date.fromordinal(d.toordinal()) == d``. Nrrrr toordinalzIDate.toordinalr!rcy)zReturn the day of the week as an integer. Monday is 0 and Sunday is 6. For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. .. seealso:: `isoweekday`. Nrrrrweekdayz IDate.weekdayr!rcy)zReturn the day of the week as an integer. Monday is 1 and Sunday is 7. For example, date(2002, 12, 4).isoweekday() == 3, a Wednesday. .. seealso:: `weekday`, `isocalendar`. Nrrrr isoweekdayzIDate.isoweekdayr!rcy)amReturn a 3-tuple, (ISO year, ISO week number, ISO weekday). The ISO calendar is a widely used variant of the Gregorian calendar. See http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm for a good explanation. The ISO year consists of 52 or 53 full weeks, and where a week starts on a Monday and ends on a Sunday. The first week of an ISO year is the first (Gregorian) calendar week of a year containing a Thursday. This is called week number 1, and the ISO year of that Thursday is the same as its Gregorian year. For example, 2004 begins on a Thursday, so the first week of ISO year 2004 begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004, so that ``date(2003, 12, 29).isocalendar() == (2004, 1, 1)`` and ``date(2004, 1, 4).isocalendar() == (2004, 1, 7)``. Nrrrr isocalendarzIDate.isocalendarr!rcy)zReturn a string representing the date in ISO 8601 format. This is 'YYYY-MM-DD'. For example, ``date(2002, 12, 4).isoformat() == '2002-12-04'``. Nrrrr isoformatzIDate.isoformatr!rcy)z>For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``.Nrrrr__str__z IDate.__str__r!rcy)apReturn a string representing the date. For example date(2002, 12, 4).ctime() == 'Wed Dec 4 00:00:00 2002'. d.ctime() is equivalent to time.ctime(time.mktime(d.timetuple())) on platforms where the native C ctime() function (which `time.ctime` invokes, but which date.ctime() does not invoke) conforms to the C standard. Nrrrrctimez IDate.ctimer!rcy)zReturn a string representing the date. Controlled by an explicit format string. Format codes referring to hours, minutes or seconds will see 0 values. Nrformats rstrftimezIDate.strftimer!rN)rrrrr r-r.r/r0r2r4r6r8r:r<r>r@rDrrrr+r+gs`  = >D 2 3E P RC      & M  rr+cneZdZdZedZedZedZdZd dZ dZ d d Z d Z d Z d Zy)IDateTimeClasszThis is the datetime class interface. This is symbolic; this module does **not** make `datetime.datetime` provide this interface. z#The earliest representable datetimez!The latest representable datetimezCThe smallest possible difference between non-equal datetime objectscy)zReturn the current local datetime, with tzinfo None. This is equivalent to ``datetime.fromtimestamp(time.time())``. .. seealso:: `now`, `fromtimestamp`. Nrrrrr zIDateTimeClass.todayr!rNcy)auReturn the current local date and time. If optional argument *tz* is None or not specified, this is like `today`, but, if possible, supplies more precision than can be gotten from going through a `time.time` timestamp (for example, this may be possible on platforms supplying the C ``gettimeofday()`` function). Else tz must be an instance of a class tzinfo subclass, and the current date and time are converted to tz's time zone. In this case the result is equivalent to tz.fromutc(datetime.utcnow().replace(tzinfo=tz)). .. seealso:: `today`, `utcnow`. Nrtzs rnowzIDateTimeClass.nowr!rcy)zReturn the current UTC date and time, with tzinfo None. This is like `now`, but returns the current UTC date and time, as a naive datetime object. .. seealso:: `now`. NrrrrutcnowzIDateTimeClass.utcnowr!rcy)aUReturn the local date and time corresponding to the POSIX timestamp. Same as is returned by time.time(). If optional argument tz is None or not specified, the timestamp is converted to the platform's local date and time, and the returned datetime object is naive. Else tz must be an instance of a class tzinfo subclass, and the timestamp is converted to tz's time zone. In this case the result is equivalent to ``tz.fromutc(datetime.utcfromtimestamp(timestamp).replace(tzinfo=tz))``. fromtimestamp() may raise `ValueError`, if the timestamp is out of the range of values supported by the platform C localtime() or gmtime() functions. It's common for this to be restricted to years in 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by fromtimestamp(), and then it's possible to have two timestamps differing by a second that yield identical datetime objects. .. seealso:: `utcfromtimestamp`. Nr)r$rJs rr%zIDateTimeClass.fromtimestampr!rcy)aOReturn the UTC datetime from the POSIX timestamp with tzinfo None. This may raise `ValueError`, if the timestamp is out of the range of values supported by the platform C ``gmtime()`` function. It's common for this to be restricted to years in 1970 through 2038. .. seealso:: `fromtimestamp`. Nrr#s rutcfromtimestampzIDateTimeClass.utcfromtimestampr!rcy)a$Return the datetime from the proleptic Gregorian ordinal. January 1 of year 1 has ordinal 1. `ValueError` is raised unless 1 <= ordinal <= datetime.max.toordinal(). The hour, minute, second and microsecond of the result are all 0, and tzinfo is None. Nrr's rr)zIDateTimeClass.fromordinal"r!rcy)a[Return a new datetime object. Its date members are equal to the given date object's, and whose time and tzinfo members are equal to the given time object's. For any datetime object *d*, ``d == datetime.combine(d.date(), d.timetz())``. If date is a datetime object, its time and tzinfo members are ignored. Nr)rrs rcombinezIDateTimeClass.combine+r!r)N)rrrrr rrrr rKrMr%rPr)rSrrrrFrFsP 9 :C 7 8CMOJ     .   rrFceZdZdZedZedZedZedZedZ edZ edZ ed Z d Z d Zd Zd ZdZdZdZdZdZdZdZdZdZdZddZdZdZdZy) IDateTimezwObject contains all the information from a date object and a time object. Implemented by `datetime.datetime`. z*Year between MINYEAR and MAXYEAR inclusivez Month between 1 and 12 inclusivezCDay between 1 and the number of days in the given month of the yearHour in range(24)Minute in range(60)Second in range(60)Microsecond in range(1000000)zgThe object passed as the tzinfo argument to the datetime constructor or None if none was passedcy)z1Return date object with same year, month and day.NrrrrrzIDateTime.dateNr!rcy)zReturn time object with same hour, minute, second, microsecond. tzinfo is None. .. seealso:: Method :meth:`timetz`. NrrrrrzIDateTime.timeQr!rcy)zReturn time object with same hour, minute, second, microsecond, and tzinfo. .. seealso:: Method :meth:`time`. NrrrrtimetzzIDateTime.timetzYr!rcy)a,Return a datetime with the same members, except for those members given new values by whichever keyword arguments are specified. Note that ``tzinfo=None`` can be specified to create a naive datetime from an aware datetime with no conversion of date and time members. Nr)r-r.r/hourminutesecond microsecondrs rr0zIDateTime.replace`r!rcy)aReturn a datetime object with new tzinfo member tz, adjusting the date and time members so the result is the same UTC time as self, but in tz's local time. tz must be an instance of a tzinfo subclass, and its utcoffset() and dst() methods must not return None. self must be aware (self.tzinfo must not be None, and self.utcoffset() must not return None). If self.tzinfo is tz, self.astimezone(tz) is equal to self: no adjustment of date or time members is performed. Else the result is local time in time zone tz, representing the same UTC time as self: after astz = dt.astimezone(tz), astz - astz.utcoffset() will usually have the same date and time members as dt - dt.utcoffset(). The discussion of class `datetime.tzinfo` explains the cases at Daylight Saving Time transition boundaries where this cannot be achieved (an issue only if tz models both standard and daylight time). If you merely want to attach a time zone object *tz* to a datetime *dt* without adjustment of date and time members, use ``dt.replace(tzinfo=tz)``. If you merely want to remove the time zone object from an aware datetime dt without conversion of date and time members, use ``dt.replace(tzinfo=None)``. Note that the default `tzinfo.fromutc` method can be overridden in a tzinfo subclass to effect the result returned by `astimezone`. NrrIs r astimezonezIDateTime.astimezonehr!rcy)zQReturn the timezone offset in minutes east of UTC (negative west of UTC).Nrrrr utcoffsetzIDateTime.utcoffsetr!rcy)zoReturn 0 if DST is not in effect, or the DST offset (in minutes eastward) if DST is in effect. Nrrrrdstz IDateTime.dstr!rcy)zReturn the timezone name.NrrrrtznamezIDateTime.tznamer!rcy)zBReturn a 9-element tuple of the form returned by `time.localtime`.Nrrrrr2zIDateTime.timetupler!rcy)z5Return UTC time tuple compatilble with `time.gmtime`.Nrrrr utctimetuplezIDateTime.utctimetupler!rcy)zjReturn the proleptic Gregorian ordinal of the date. The same as self.date().toordinal(). Nrrrrr4zIDateTime.toordinalr!rcy)zReturn the day of the week as an integer. Monday is 0 and Sunday is 6. The same as self.date().weekday(). See also isoweekday(). Nrrrrr6zIDateTime.weekdayr!rcy)zReturn the day of the week as an integer. Monday is 1 and Sunday is 7. The same as self.date().isoweekday. .. seealso:: `weekday`, `isocalendar`. Nrrrrr8zIDateTime.isoweekdayr!rcy)ztReturn a 3-tuple, (ISO year, ISO week number, ISO weekday). The same as self.date().isocalendar(). Nrrrrr:zIDateTime.isocalendarr!rcy)aReturn a string representing the date and time in ISO 8601 format. YYYY-MM-DDTHH:MM:SS.mmmmmm or YYYY-MM-DDTHH:MM:SS if microsecond is 0 If `utcoffset` does not return None, a 6-character string is appended, giving the UTC offset in (signed) hours and minutes: YYYY-MM-DDTHH:MM:SS.mmmmmm+HH:MM or YYYY-MM-DDTHH:MM:SS+HH:MM if microsecond is 0. The optional argument sep (default 'T') is a one-character separator, placed between the date and time portions of the result. Nr)seps rr<zIDateTime.isoformatr!rcy)zWFor a datetime instance *d*, ``str(d)`` is equivalent to ``d.isoformat(' ')``. Nrrrrr>zIDateTime.__str__r!rcy)aReturn a string representing the date and time. ``datetime(2002, 12, 4, 20, 30, 40).ctime() == 'Wed Dec 4 20:30:40 2002'``. ``d.ctime()`` is equivalent to ``time.ctime(time.mktime(d.timetuple()))`` on platforms where the native C ``ctime()`` function (which `time.ctime` invokes, but which `datetime.ctime` does not invoke) conforms to the C standard. Nrrrrr@zIDateTime.ctimer!rcy)zrReturn a string representing the date and time. This is controlled by an explicit format string. NrrBs rrDzIDateTime.strftimer!rN)T)rrrrr r-r.r/r_r`rarbrrrr]r0rdrfrhrjr2rmr4r6r8r:r<r>r@rDrrrrUrU5s A BD 8 9E M OC ( )D , -F , -F;z ITime.__str__r!rcy)ziReturn a string representing the time. This is controlled by an explicit format string. NrrBs rrDzITime.strftimer!rcy)a_Return the timezone offset in minutes east of UTC (negative west of UTC). If tzinfo is None, returns None, else returns self.tzinfo.utcoffset(None), and raises an exception if the latter doesn't return None or a timedelta object representing a whole number of minutes with magnitude less than one day. NrrrrrfzITime.utcoffsetr!rcy)aoReturn 0 if DST is not in effect, or the DST offset (in minutes eastward) if DST is in effect. If tzinfo is None, returns None, else returns self.tzinfo.dst(None), and raises an exception if the latter doesn't return None, or a timedelta object representing a whole number of minutes with magnitude less than one day. Nrrrrrhz ITime.dst#r!rcy)zReturn the timezone name. If tzinfo is None, returns None, else returns self.tzinfo.tzname(None), or raises an exception if the latter doesn't return None or a string object. Nrrrrrjz ITime.tzname-r!rN)rrrrr r_r`rarbrr0r<r>rDrfrhrjrrrr{r{sh ( )D , -F , -F;rs =</* Gi GLL4$ $ Ni Ji X_ Y_ D_ ~_ D K K L JL ^BiB> :&e)$e r