Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.datetimetester.SubclassTime Class Reference
Inheritance diagram for test.datetimetester.SubclassTime:
Inheritance graph
[legend]
Collaboration diagram for test.datetimetester.SubclassTime:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __new__
def hour
def minute
def second
def microsecond
def tzinfo
def __eq__
def __ne__
def __le__
def __lt__
def __ge__
def __gt__
def __hash__
def __repr__
def isoformat
def strftime
def __format__
def utcoffset
def tzname
def dst
def replace
def __bool__
def __reduce__

Static Public Attributes

int sub_var = 1

Detailed Description

Definition at line 1963 of file datetimetester.py.


Member Function Documentation

def datetime.time.__bool__ (   self) [inherited]

Definition at line 1264 of file datetime.py.

01264 
01265     def __bool__(self):
01266         if self.second or self.microsecond:
01267             return True
01268         offset = self.utcoffset() or timedelta(0)
01269         return timedelta(hours=self.hour, minutes=self.minute) != offset

Here is the call graph for this function:

def datetime.time.__eq__ (   self,
  other 
) [inherited]

Definition at line 1070 of file datetime.py.

01070 
01071     def __eq__(self, other):
01072         if isinstance(other, time):
01073             return self._cmp(other) == 0
01074         else:
01075             return False

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.time.__format__ (   self,
  fmt 
) [inherited]

Definition at line 1203 of file datetime.py.

01203 
01204     def __format__(self, fmt):
01205         if len(fmt) != 0:
01206             return self.strftime(fmt)
01207         return str(self)

Here is the call graph for this function:

def datetime.time.__ge__ (   self,
  other 
) [inherited]

Definition at line 1094 of file datetime.py.

01094 
01095     def __ge__(self, other):
01096         if isinstance(other, time):
01097             return self._cmp(other) >= 0
01098         else:
01099             _cmperror(self, other)

Here is the call graph for this function:

def datetime.time.__gt__ (   self,
  other 
) [inherited]

Definition at line 1100 of file datetime.py.

01100 
01101     def __gt__(self, other):
01102         if isinstance(other, time):
01103             return self._cmp(other) > 0
01104         else:
01105             _cmperror(self, other)

Here is the call graph for this function:

def datetime.time.__hash__ (   self) [inherited]
Hash.

Definition at line 1131 of file datetime.py.

01131 
01132     def __hash__(self):
01133         """Hash."""
01134         tzoff = self.utcoffset()
01135         if not tzoff: # zero or None
01136             return hash(self._getstate()[0])
01137         h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,
01138                       timedelta(hours=1))
01139         assert not m % timedelta(minutes=1), "whole minute"
01140         m //= timedelta(minutes=1)
01141         if 0 <= h < 24:
01142             return hash(time(h, m, self.second, self.microsecond))
01143         return hash((h, m, self.second, self.microsecond))

Here is the call graph for this function:

def datetime.time.__le__ (   self,
  other 
) [inherited]

Definition at line 1082 of file datetime.py.

01082 
01083     def __le__(self, other):
01084         if isinstance(other, time):
01085             return self._cmp(other) <= 0
01086         else:
01087             _cmperror(self, other)

Here is the call graph for this function:

def datetime.time.__lt__ (   self,
  other 
) [inherited]

Definition at line 1088 of file datetime.py.

01088 
01089     def __lt__(self, other):
01090         if isinstance(other, time):
01091             return self._cmp(other) < 0
01092         else:
01093             _cmperror(self, other)

Here is the call graph for this function:

def datetime.time.__ne__ (   self,
  other 
) [inherited]

Definition at line 1076 of file datetime.py.

01076 
01077     def __ne__(self, other):
01078         if isinstance(other, time):
01079             return self._cmp(other) != 0
01080         else:
01081             return True

Here is the call graph for this function:

def datetime.time.__new__ (   cls,
  hour = 0,
  minute = 0,
  second = 0,
  microsecond = 0,
  tzinfo = None 
) [inherited]
Constructor.

Arguments:

hour, minute (required)
second, microsecond (default to zero)
tzinfo (default to None)

Definition at line 1017 of file datetime.py.

01017 
01018     def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None):
01019         """Constructor.
01020 
01021         Arguments:
01022 
01023         hour, minute (required)
01024         second, microsecond (default to zero)
01025         tzinfo (default to None)
01026         """
01027         self = object.__new__(cls)
01028         if isinstance(hour, bytes) and len(hour) == 6:
01029             # Pickle support
01030             self.__setstate(hour, minute or None)
01031             return self
01032         _check_tzinfo_arg(tzinfo)
01033         _check_time_fields(hour, minute, second, microsecond)
01034         self._hour = hour
01035         self._minute = minute
01036         self._second = second
01037         self._microsecond = microsecond
01038         self._tzinfo = tzinfo
01039         return self

Here is the call graph for this function:

def datetime.time.__reduce__ (   self) [inherited]

Definition at line 1293 of file datetime.py.

01293 
01294     def __reduce__(self):
01295         return (time, self._getstate())

Here is the call graph for this function:

def datetime.time.__repr__ (   self) [inherited]
Convert to formal string, for repr().

Definition at line 1162 of file datetime.py.

01162 
01163     def __repr__(self):
01164         """Convert to formal string, for repr()."""
01165         if self._microsecond != 0:
01166             s = ", %d, %d" % (self._second, self._microsecond)
01167         elif self._second != 0:
01168             s = ", %d" % self._second
01169         else:
01170             s = ""
01171         s= "%s(%d, %d%s)" % ('datetime.' + self.__class__.__name__,
01172                              self._hour, self._minute, s)
01173         if self._tzinfo is not None:
01174             assert s[-1:] == ")"
01175             s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")"
01176         return s

def datetime.time.dst (   self) [inherited]
Return 0 if DST is not in effect, or the DST offset (in minutes
eastward) if DST is in effect.

This is purely informational; the DST offset has already been added to
the UTC offset returned by utcoffset() if applicable, so there's no
need to consult dst() unless you're interested in displaying the DST
info.

Definition at line 1232 of file datetime.py.

01232 
01233     def dst(self):
01234         """Return 0 if DST is not in effect, or the DST offset (in minutes
01235         eastward) if DST is in effect.
01236 
01237         This is purely informational; the DST offset has already been added to
01238         the UTC offset returned by utcoffset() if applicable, so there's no
01239         need to consult dst() unless you're interested in displaying the DST
01240         info.
01241         """
01242         if self._tzinfo is None:
01243             return None
01244         offset = self._tzinfo.dst(None)
01245         _check_utc_offset("dst", offset)
01246         return offset

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.time.hour (   self) [inherited]
hour (0-23)

Definition at line 1042 of file datetime.py.

01042 
01043     def hour(self):
01044         """hour (0-23)"""
01045         return self._hour

Here is the caller graph for this function:

def datetime.time.isoformat (   self) [inherited]
Return the time formatted according to ISO.

This is 'HH:MM:SS.mmmmmm+zz:zz', or 'HH:MM:SS+zz:zz' if
self.microsecond == 0.

Definition at line 1177 of file datetime.py.

01177 
01178     def isoformat(self):
01179         """Return the time formatted according to ISO.
01180 
01181         This is 'HH:MM:SS.mmmmmm+zz:zz', or 'HH:MM:SS+zz:zz' if
01182         self.microsecond == 0.
01183         """
01184         s = _format_time(self._hour, self._minute, self._second,
01185                          self._microsecond)
01186         tz = self._tzstr()
01187         if tz:
01188             s += tz
01189         return s

Here is the call graph for this function:

def datetime.time.microsecond (   self) [inherited]
microsecond (0-999999)

Definition at line 1057 of file datetime.py.

01057 
01058     def microsecond(self):
01059         """microsecond (0-999999)"""
01060         return self._microsecond

Here is the caller graph for this function:

def datetime.time.minute (   self) [inherited]
minute (0-59)

Definition at line 1047 of file datetime.py.

01047 
01048     def minute(self):
01049         """minute (0-59)"""
01050         return self._minute

Here is the caller graph for this function:

def datetime.time.replace (   self,
  hour = None,
  minute = None,
  second = None,
  microsecond = None,
  tzinfo = True 
) [inherited]
Return a new time with new values for the specified fields.

Definition at line 1248 of file datetime.py.

01248 
01249                 tzinfo=True):
01250         """Return a new time with new values for the specified fields."""
01251         if hour is None:
01252             hour = self.hour
01253         if minute is None:
01254             minute = self.minute
01255         if second is None:
01256             second = self.second
01257         if microsecond is None:
01258             microsecond = self.microsecond
01259         if tzinfo is True:
01260             tzinfo = self.tzinfo
01261         _check_time_fields(hour, minute, second, microsecond)
01262         _check_tzinfo_arg(tzinfo)
01263         return time(hour, minute, second, microsecond, tzinfo)

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.time.second (   self) [inherited]
second (0-59)

Definition at line 1052 of file datetime.py.

01052 
01053     def second(self):
01054         """second (0-59)"""
01055         return self._second

Here is the caller graph for this function:

def datetime.time.strftime (   self,
  fmt 
) [inherited]
Format using strftime().  The date part of the timestamp passed
to underlying strftime should not be used.

Definition at line 1192 of file datetime.py.

01192 
01193     def strftime(self, fmt):
01194         """Format using strftime().  The date part of the timestamp passed
01195         to underlying strftime should not be used.
01196         """
01197         # The year must be >= 1000 else Python's strftime implementation
01198         # can raise a bogus exception.
01199         timetuple = (1900, 1, 1,
01200                      self._hour, self._minute, self._second,
01201                      0, 1, -1)
01202         return _wrap_strftime(self, fmt, timetuple)

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.time.tzinfo (   self) [inherited]
timezone info object

Definition at line 1062 of file datetime.py.

01062 
01063     def tzinfo(self):
01064         """timezone info object"""
01065         return self._tzinfo

Here is the caller graph for this function:

def datetime.time.tzname (   self) [inherited]
Return the timezone name.

Note that the name is 100% informational -- there's no requirement that
it mean anything in particular. For example, "GMT", "UTC", "-500",
"-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.

Definition at line 1219 of file datetime.py.

01219 
01220     def tzname(self):
01221         """Return the timezone name.
01222 
01223         Note that the name is 100% informational -- there's no requirement that
01224         it mean anything in particular. For example, "GMT", "UTC", "-500",
01225         "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
01226         """
01227         if self._tzinfo is None:
01228             return None
01229         name = self._tzinfo.tzname(None)
01230         _check_tzname(name)
01231         return name

Here is the call graph for this function:

def datetime.time.utcoffset (   self) [inherited]
Return the timezone offset in minutes east of UTC (negative west of
UTC).

Definition at line 1210 of file datetime.py.

01210 
01211     def utcoffset(self):
01212         """Return the timezone offset in minutes east of UTC (negative west of
01213         UTC)."""
01214         if self._tzinfo is None:
01215             return None
01216         offset = self._tzinfo.utcoffset(None)
01217         _check_utc_offset("utcoffset", offset)
01218         return offset

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1964 of file datetimetester.py.


The documentation for this class was generated from the following file: