Back to index

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

List of all members.

Public Member Functions

def __new__
def __new__
def hour
def minute
def second
def microsecond
def tzinfo
def fromtimestamp
def fromtimestamp
def utcfromtimestamp
def now
def utcnow
def combine
def timetuple
def utctimetuple
def date
def time
def timetz
def replace
def replace
def astimezone
def ctime
def isoformat
def isoformat
def __repr__
def __str__
def strptime
def utcoffset
def tzname
def dst
def __eq__
def __ne__
def __le__
def __lt__
def __ge__
def __gt__
def __add__
def __sub__
def __hash__
def __reduce__
def today
def fromordinal
def strftime
def __format__
def year
def month
def day
def toordinal
def weekday
def isoweekday
def isocalendar

Static Public Attributes

int sub_var = 1

Detailed Description

Definition at line 1383 of file datetimetester.py.


Member Function Documentation

def datetime.datetime.__add__ (   self,
  other 
) [inherited]

Reimplemented from datetime.date.

Definition at line 1689 of file datetime.py.

01689 
01690     def __add__(self, other):
01691         "Add a datetime and a timedelta."
01692         if not isinstance(other, timedelta):
01693             return NotImplemented
01694         delta = timedelta(self.toordinal(),
01695                           hours=self._hour,
01696                           minutes=self._minute,
01697                           seconds=self._second,
01698                           microseconds=self._microsecond)
01699         delta += other
01700         hour, rem = divmod(delta.seconds, 3600)
01701         minute, second = divmod(rem, 60)
01702         if 0 < delta.days <= _MAXORDINAL:
01703             return datetime.combine(date.fromordinal(delta.days),
01704                                     time(hour, minute, second,
01705                                          delta.microseconds,
01706                                          tzinfo=self._tzinfo))
01707         raise OverflowError("result out of range")

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1611 of file datetime.py.

01611 
01612     def __eq__(self, other):
01613         if isinstance(other, datetime):
01614             return self._cmp(other) == 0
01615         elif not isinstance(other, date):
01616             return NotImplemented
01617         else:
01618             return False

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 740 of file datetime.py.

00740 
00741     def __format__(self, fmt):
00742         if len(fmt) != 0:
00743             return self.strftime(fmt)
00744         return str(self)

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1643 of file datetime.py.

01643 
01644     def __ge__(self, other):
01645         if isinstance(other, datetime):
01646             return self._cmp(other) >= 0
01647         elif not isinstance(other, date):
01648             return NotImplemented
01649         else:
01650             _cmperror(self, other)

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1651 of file datetime.py.

01651 
01652     def __gt__(self, other):
01653         if isinstance(other, datetime):
01654             return self._cmp(other) > 0
01655         elif not isinstance(other, date):
01656             return NotImplemented
01657         else:
01658             _cmperror(self, other)

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1734 of file datetime.py.

01734 
01735     def __hash__(self):
01736         tzoff = self.utcoffset()
01737         if tzoff is None:
01738             return hash(self._getstate()[0])
01739         days = _ymd2ord(self.year, self.month, self.day)
01740         seconds = self.hour * 3600 + self.minute * 60 + self.second
01741         return hash(timedelta(days, seconds, self.microsecond) - tzoff)

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1627 of file datetime.py.

01627 
01628     def __le__(self, other):
01629         if isinstance(other, datetime):
01630             return self._cmp(other) <= 0
01631         elif not isinstance(other, date):
01632             return NotImplemented
01633         else:
01634             _cmperror(self, other)

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1635 of file datetime.py.

01635 
01636     def __lt__(self, other):
01637         if isinstance(other, datetime):
01638             return self._cmp(other) < 0
01639         elif not isinstance(other, date):
01640             return NotImplemented
01641         else:
01642             _cmperror(self, other)

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1619 of file datetime.py.

01619 
01620     def __ne__(self, other):
01621         if isinstance(other, datetime):
01622             return self._cmp(other) != 0
01623         elif not isinstance(other, date):
01624             return NotImplemented
01625         else:
01626             return True

Here is the call graph for this function:

def datetime.date.__new__ (   cls,
  year,
  month = None,
  day = None 
) [inherited]
Constructor.

Arguments:

year, month, day (required, base 1)

Definition at line 661 of file datetime.py.

00661 
00662     def __new__(cls, year, month=None, day=None):
00663         """Constructor.
00664 
00665         Arguments:
00666 
00667         year, month, day (required, base 1)
00668         """
00669         if (isinstance(year, bytes) and len(year) == 4 and
00670             1 <= year[2] <= 12 and month is None):  # Month is sane
00671             # Pickle support
00672             self = object.__new__(cls)
00673             self.__setstate(year)
00674             return self
00675         _check_date_fields(year, month, day)
00676         self = object.__new__(cls)
00677         self._year = year
00678         self._month = month
00679         self._day = day
00680         return self

Here is the call graph for this function:

def datetime.datetime.__new__ (   cls,
  year,
  month = None,
  day = None,
  hour = 0,
  minute = 0,
  second = 0,
  microsecond = 0,
  tzinfo = None 
) [inherited]

Definition at line 1313 of file datetime.py.

01313 
01314                 microsecond=0, tzinfo=None):
01315         if isinstance(year, bytes) and len(year) == 10:
01316             # Pickle support
01317             self = date.__new__(cls, year[:4])
01318             self.__setstate(year, month)
01319             return self
01320         _check_tzinfo_arg(tzinfo)
01321         _check_time_fields(hour, minute, second, microsecond)
01322         self = date.__new__(cls, year, month, day)
01323         self._hour = hour
01324         self._minute = minute
01325         self._second = second
01326         self._microsecond = microsecond
01327         self._tzinfo = tzinfo
01328         return self

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1766 of file datetime.py.

01766 
01767     def __reduce__(self):
01768         return (self.__class__, self._getstate())
01769 
01770 
01771 datetime.min = datetime(1, 1, 1)
01772 datetime.max = datetime(9999, 12, 31, 23, 59, 59, 999999)
01773 datetime.resolution = timedelta(microseconds=1)
01774 

Here is the call graph for this function:

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

Reimplemented from datetime.date.

Definition at line 1549 of file datetime.py.

01549 
01550     def __repr__(self):
01551         """Convert to formal string, for repr()."""
01552         L = [self._year, self._month, self._day, # These are never zero
01553              self._hour, self._minute, self._second, self._microsecond]
01554         if L[-1] == 0:
01555             del L[-1]
01556         if L[-1] == 0:
01557             del L[-1]
01558         s = ", ".join(map(str, L))
01559         s = "%s(%s)" % ('datetime.' + self.__class__.__name__, s)
01560         if self._tzinfo is not None:
01561             assert s[-1:] == ")"
01562             s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")"
01563         return s

def datetime.datetime.__str__ (   self) [inherited]

Definition at line 1564 of file datetime.py.

01564 
01565     def __str__(self):
01566         "Convert to string, for str()."
01567         return self.isoformat(sep=' ')

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.datetime.__sub__ (   self,
  other 
) [inherited]
Subtract two dates, or a date and a timedelta.

Reimplemented from datetime.date.

Definition at line 1710 of file datetime.py.

01710 
01711     def __sub__(self, other):
01712         "Subtract two datetimes, or a datetime and a timedelta."
01713         if not isinstance(other, datetime):
01714             if isinstance(other, timedelta):
01715                 return self + -other
01716             return NotImplemented
01717 
01718         days1 = self.toordinal()
01719         days2 = other.toordinal()
01720         secs1 = self._second + self._minute * 60 + self._hour * 3600
01721         secs2 = other._second + other._minute * 60 + other._hour * 3600
01722         base = timedelta(days1 - days2,
01723                          secs1 - secs2,
01724                          self._microsecond - other._microsecond)
01725         if self._tzinfo is other._tzinfo:
01726             return base
01727         myoff = self.utcoffset()
01728         otoff = other.utcoffset()
01729         if myoff == otoff:
01730             return base
01731         if myoff is None or otoff is None:
01732             raise TypeError("cannot mix naive and timezone-aware time")
01733         return base + otoff - myoff

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.datetime.astimezone (   self,
  tz 
) [inherited]

Definition at line 1488 of file datetime.py.

01488 
01489     def astimezone(self, tz):
01490         if not isinstance(tz, tzinfo):
01491             raise TypeError("tz argument must be an instance of tzinfo")
01492 
01493         mytz = self.tzinfo
01494         if mytz is None:
01495             raise ValueError("astimezone() requires an aware datetime")
01496 
01497         if tz is mytz:
01498             return self
01499 
01500         # Convert self to UTC, and attach the new time zone object.
01501         myoffset = self.utcoffset()
01502         if myoffset is None:
01503             raise ValueError("astimezone() requires an aware datetime")
01504         utc = (self - myoffset).replace(tzinfo=tz)
01505 
01506         # Convert from UTC to tz's local time.
01507         return tz.fromutc(utc)

Here is the call graph for this function:

def datetime.datetime.combine (   cls,
  date,
  time 
) [inherited]

Definition at line 1418 of file datetime.py.

01418 
01419     def combine(cls, date, time):
01420         "Construct a datetime from a given date and a given time."
01421         if not isinstance(date, _date_class):
01422             raise TypeError("date argument must be a date instance")
01423         if not isinstance(time, _time_class):
01424             raise TypeError("time argument must be a time instance")
01425         return cls(date.year, date.month, date.day,
01426                    time.hour, time.minute, time.second, time.microsecond,
01427                    time.tzinfo)

def datetime.datetime.ctime (   self) [inherited]

Reimplemented from datetime.date.

Definition at line 1510 of file datetime.py.

01510 
01511     def ctime(self):
01512         "Return ctime() style string."
01513         weekday = self.toordinal() % 7 or 7
01514         return "%s %s %2d %02d:%02d:%02d %04d" % (
01515             _DAYNAMES[weekday],
01516             _MONTHNAMES[self._month],
01517             self._day,
01518             self._hour, self._minute, self._second,
01519             self._year)

Here is the call graph for this function:

def datetime.datetime.date (   self) [inherited]

Definition at line 1450 of file datetime.py.

01450 
01451     def date(self):
01452         "Return the date part."
01453         return date(self._year, self._month, self._day)

def datetime.date.day (   self) [inherited]
day (1-31)

Definition at line 770 of file datetime.py.

00770 
00771     def day(self):
00772         """day (1-31)"""
00773         return self._day

Here is the caller graph for this function:

def datetime.datetime.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 1594 of file datetime.py.

01594 
01595     def dst(self):
01596         """Return 0 if DST is not in effect, or the DST offset (in minutes
01597         eastward) if DST is in effect.
01598 
01599         This is purely informational; the DST offset has already been added to
01600         the UTC offset returned by utcoffset() if applicable, so there's no
01601         need to consult dst() unless you're interested in displaying the DST
01602         info.
01603         """
01604         if self._tzinfo is None:
01605             return None
01606         offset = self._tzinfo.dst(self)
01607         _check_utc_offset("dst", offset)
01608         return offset

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.date.fromordinal (   cls,
  n 
) [inherited]
Contruct a date from a proleptic Gregorian ordinal.

January 1 of year 1 is day 1.  Only the year, month and day are
non-zero in the result.

Definition at line 696 of file datetime.py.

00696 
00697     def fromordinal(cls, n):
00698         """Contruct a date from a proleptic Gregorian ordinal.
00699 
00700         January 1 of year 1 is day 1.  Only the year, month and day are
00701         non-zero in the result.
00702         """
00703         y, m, d = _ord2ymd(n)
00704         return cls(y, m, d)

Here is the call graph for this function:

def datetime.date.fromtimestamp (   cls,
  t 
) [inherited]

Definition at line 684 of file datetime.py.

00684 
00685     def fromtimestamp(cls, t):
00686         "Construct a date from a POSIX timestamp (like time.time())."
00687         y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)
00688         return cls(y, m, d)

def datetime.datetime.fromtimestamp (   cls,
  t,
  tz = None 
) [inherited]
Construct a datetime from a POSIX timestamp (like time.time()).

A timezone info object may be passed in as well.

Definition at line 1356 of file datetime.py.

01356 
01357     def fromtimestamp(cls, t, tz=None):
01358         """Construct a datetime from a POSIX timestamp (like time.time()).
01359 
01360         A timezone info object may be passed in as well.
01361         """
01362 
01363         _check_tzinfo_arg(tz)
01364 
01365         converter = _time.localtime if tz is None else _time.gmtime
01366 
01367         t, frac = divmod(t, 1.0)
01368         us = round(frac * 1e6)
01369 
01370         # If timestamp is less than one microsecond smaller than a
01371         # full second, us can be rounded up to 1000000.  In this case,
01372         # roll over to seconds, otherwise, ValueError is raised
01373         # by the constructor.
01374         if us == 1000000:
01375             t += 1
01376             us = 0
01377         y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)
01378         ss = min(ss, 59)    # clamp out leap seconds if the platform has them
01379         result = cls(y, m, d, hh, mm, ss, us, tz)
01380         if tz is not None:
01381             result = tz.fromutc(result)
01382         return result

Here is the call graph for this function:

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

Definition at line 1331 of file datetime.py.

01331 
01332     def hour(self):
01333         """hour (0-23)"""
01334         return self._hour

Here is the caller graph for this function:

def datetime.date.isocalendar (   self) [inherited]
Return a 3-tuple containing ISO year, week number, and weekday.

The first ISO week of the year is the (Mon-Sun) week
containing the year's first Thursday; everything else derives
from that.

The first week is 1; Monday is 1 ... Sunday is 7.

ISO calendar algorithm taken from
http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm

Definition at line 876 of file datetime.py.

00876 
00877     def isocalendar(self):
00878         """Return a 3-tuple containing ISO year, week number, and weekday.
00879 
00880         The first ISO week of the year is the (Mon-Sun) week
00881         containing the year's first Thursday; everything else derives
00882         from that.
00883 
00884         The first week is 1; Monday is 1 ... Sunday is 7.
00885 
00886         ISO calendar algorithm taken from
00887         http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
00888         """
00889         year = self._year
00890         week1monday = _isoweek1monday(year)
00891         today = _ymd2ord(self._year, self._month, self._day)
00892         # Internally, week and day have origin 0
00893         week, day = divmod(today - week1monday, 7)
00894         if week < 0:
00895             year -= 1
00896             week1monday = _isoweek1monday(year)
00897             week, day = divmod(today - week1monday, 7)
00898         elif week >= 52:
00899             if today >= _isoweek1monday(year+1):
00900                 year += 1
00901                 week = 0
00902         return year, week+1, day+1

Here is the call graph for this function:

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

This is 'YYYY-MM-DD'.

References:
- http://www.w3.org/TR/NOTE-datetime
- http://www.cl.cam.ac.uk/~mgk25/iso-time.html

Definition at line 745 of file datetime.py.

00745 
00746     def isoformat(self):
00747         """Return the date formatted according to ISO.
00748 
00749         This is 'YYYY-MM-DD'.
00750 
00751         References:
00752         - http://www.w3.org/TR/NOTE-datetime
00753         - http://www.cl.cam.ac.uk/~mgk25/iso-time.html
00754         """
00755         return "%04d-%02d-%02d" % (self._year, self._month, self._day)

Here is the caller graph for this function:

def datetime.datetime.isoformat (   self,
  sep = 'T' 
) [inherited]
Return the time formatted according to ISO.

This is 'YYYY-MM-DD HH:MM:SS.mmmmmm', or 'YYYY-MM-DD HH:MM:SS' if
self.microsecond == 0.

If self.tzinfo is not None, the UTC offset is also attached, giving
'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM' or 'YYYY-MM-DD HH:MM:SS+HH:MM'.

Optional argument sep specifies the separator between date and
time, default 'T'.

Definition at line 1520 of file datetime.py.

01520 
01521     def isoformat(self, sep='T'):
01522         """Return the time formatted according to ISO.
01523 
01524         This is 'YYYY-MM-DD HH:MM:SS.mmmmmm', or 'YYYY-MM-DD HH:MM:SS' if
01525         self.microsecond == 0.
01526 
01527         If self.tzinfo is not None, the UTC offset is also attached, giving
01528         'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM' or 'YYYY-MM-DD HH:MM:SS+HH:MM'.
01529 
01530         Optional argument sep specifies the separator between date and
01531         time, default 'T'.
01532         """
01533         s = ("%04d-%02d-%02d%c" % (self._year, self._month, self._day,
01534                                   sep) +
01535                 _format_time(self._hour, self._minute, self._second,
01536                              self._microsecond))
01537         off = self.utcoffset()
01538         if off is not None:
01539             if off.days < 0:
01540                 sign = "-"
01541                 off = -off
01542             else:
01543                 sign = "+"
01544             hh, mm = divmod(off, timedelta(hours=1))
01545             assert not mm % timedelta(minutes=1), "whole minute"
01546             mm //= timedelta(minutes=1)
01547             s += "%s%02d:%02d" % (sign, hh, mm)
01548         return s

Here is the call graph for this function:

def datetime.date.isoweekday (   self) [inherited]

Definition at line 871 of file datetime.py.

00871 
00872     def isoweekday(self):
00873         "Return day of the week, where Monday == 1 ... Sunday == 7."
00874         # 1-Jan-0001 is a Monday
00875         return self.toordinal() % 7 or 7

Here is the call graph for this function:

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

Definition at line 1346 of file datetime.py.

01346 
01347     def microsecond(self):
01348         """microsecond (0-999999)"""
01349         return self._microsecond

Here is the caller graph for this function:

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

Definition at line 1336 of file datetime.py.

01336 
01337     def minute(self):
01338         """minute (0-59)"""
01339         return self._minute

Here is the caller graph for this function:

def datetime.date.month (   self) [inherited]
month (1-12)

Definition at line 765 of file datetime.py.

00765 
00766     def month(self):
00767         """month (1-12)"""
00768         return self._month

Here is the caller graph for this function:

def datetime.datetime.now (   cls,
  tz = None 
) [inherited]

Definition at line 1406 of file datetime.py.

01406 
01407     def now(cls, tz=None):
01408         "Construct a datetime from time.time() and optional time zone info."
01409         t = _time.time()
01410         return cls.fromtimestamp(t, tz)

Here is the caller graph for this function:

def datetime.date.replace (   self,
  year = None,
  month = None,
  day = None 
) [inherited]
Return a new date with new values for the specified fields.

Definition at line 789 of file datetime.py.

00789 
00790     def replace(self, year=None, month=None, day=None):
00791         """Return a new date with new values for the specified fields."""
00792         if year is None:
00793             year = self._year
00794         if month is None:
00795             month = self._month
00796         if day is None:
00797             day = self._day
00798         _check_date_fields(year, month, day)
00799         return date(year, month, day)

Here is the call graph for this function:

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

Definition at line 1464 of file datetime.py.

01464 
01465                 minute=None, second=None, microsecond=None, tzinfo=True):
01466         """Return a new datetime with new values for the specified fields."""
01467         if year is None:
01468             year = self.year
01469         if month is None:
01470             month = self.month
01471         if day is None:
01472             day = self.day
01473         if hour is None:
01474             hour = self.hour
01475         if minute is None:
01476             minute = self.minute
01477         if second is None:
01478             second = self.second
01479         if microsecond is None:
01480             microsecond = self.microsecond
01481         if tzinfo is True:
01482             tzinfo = self.tzinfo
01483         _check_date_fields(year, month, day)
01484         _check_time_fields(hour, minute, second, microsecond)
01485         _check_tzinfo_arg(tzinfo)
01486         return datetime(year, month, day, hour, minute, second,
01487                           microsecond, tzinfo)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1341 of file datetime.py.

01341 
01342     def second(self):
01343         """second (0-59)"""
01344         return self._second

Here is the caller graph for this function:

def datetime.date.strftime (   self,
  fmt 
) [inherited]

Definition at line 736 of file datetime.py.

00736 
00737     def strftime(self, fmt):
00738         "Format using strftime()."
00739         return _wrap_strftime(self, fmt, self.timetuple())

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.datetime.strptime (   cls,
  date_string,
  format 
) [inherited]

Definition at line 1569 of file datetime.py.

01569 
01570     def strptime(cls, date_string, format):
01571         'string, format -> new datetime parsed from a string (like time.strptime()).'
01572         import _strptime
01573         return _strptime._strptime_datetime(cls, date_string, format)

Here is the call graph for this function:

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

Definition at line 1454 of file datetime.py.

01454 
01455     def time(self):
01456         "Return the time part, with tzinfo None."
01457         return time(self.hour, self.minute, self.second, self.microsecond)

Here is the call graph for this function:

def datetime.datetime.timetuple (   self) [inherited]

Reimplemented from datetime.date.

Definition at line 1428 of file datetime.py.

01428 
01429     def timetuple(self):
01430         "Return local time tuple compatible with time.localtime()."
01431         dst = self.dst()
01432         if dst is None:
01433             dst = -1
01434         elif dst:
01435             dst = 1
01436         else:
01437             dst = 0
01438         return _build_struct_time(self.year, self.month, self.day,
01439                                   self.hour, self.minute, self.second,
01440                                   dst)

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.datetime.timetz (   self) [inherited]

Definition at line 1458 of file datetime.py.

01458 
01459     def timetz(self):
01460         "Return the time part, with same tzinfo."
01461         return time(self.hour, self.minute, self.second, self.microsecond,
01462                     self._tzinfo)

Here is the call graph for this function:

def datetime.date.today (   cls) [inherited]

Definition at line 690 of file datetime.py.

00690 
00691     def today(cls):
00692         "Construct a date from time.time()."
00693         t = _time.time()
00694         return cls.fromtimestamp(t)

Here is the caller graph for this function:

def datetime.date.toordinal (   self) [inherited]
Return proleptic Gregorian ordinal for the year, month and day.

January 1 of year 1 is day 1.  Only the year, month and day values
contribute to the result.

Definition at line 781 of file datetime.py.

00781 
00782     def toordinal(self):
00783         """Return proleptic Gregorian ordinal for the year, month and day.
00784 
00785         January 1 of year 1 is day 1.  Only the year, month and day values
00786         contribute to the result.
00787         """
00788         return _ymd2ord(self._year, self._month, self._day)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1351 of file datetime.py.

01351 
01352     def tzinfo(self):
01353         """timezone info object"""
01354         return self._tzinfo

Here is the caller graph for this function:

def datetime.datetime.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 1583 of file datetime.py.

01583 
01584     def tzname(self):
01585         """Return the timezone name.
01586 
01587         Note that the name is 100% informational -- there's no requirement that
01588         it mean anything in particular. For example, "GMT", "UTC", "-500",
01589         "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
01590         """
01591         name = _call_tzinfo_method(self._tzinfo, "tzname", self)
01592         _check_tzname(name)
01593         return name

Here is the call graph for this function:

def datetime.datetime.utcfromtimestamp (   cls,
  t 
) [inherited]

Definition at line 1384 of file datetime.py.

01384 
01385     def utcfromtimestamp(cls, t):
01386         "Construct a UTC datetime from a POSIX timestamp (like time.time())."
01387         t, frac = divmod(t, 1.0)
01388         us = round(frac * 1e6)
01389 
01390         # If timestamp is less than one microsecond smaller than a
01391         # full second, us can be rounded up to 1000000.  In this case,
01392         # roll over to seconds, otherwise, ValueError is raised
01393         # by the constructor.
01394         if us == 1000000:
01395             t += 1
01396             us = 0
01397         y, m, d, hh, mm, ss, weekday, jday, dst = _time.gmtime(t)
01398         ss = min(ss, 59)    # clamp out leap seconds if the platform has them
01399         return cls(y, m, d, hh, mm, ss, us)

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.datetime.utcnow (   cls) [inherited]

Definition at line 1412 of file datetime.py.

01412 
01413     def utcnow(cls):
01414         "Construct a UTC datetime from time.time()."
01415         t = _time.time()
01416         return cls.utcfromtimestamp(t)

Here is the caller graph for this function:

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

Definition at line 1574 of file datetime.py.

01574 
01575     def utcoffset(self):
01576         """Return the timezone offset in minutes east of UTC (negative west of
01577         UTC)."""
01578         if self._tzinfo is None:
01579             return None
01580         offset = self._tzinfo.utcoffset(self)
01581         _check_utc_offset("utcoffset", offset)
01582         return offset

Here is the call graph for this function:

Here is the caller graph for this function:

def datetime.datetime.utctimetuple (   self) [inherited]

Definition at line 1441 of file datetime.py.

01441 
01442     def utctimetuple(self):
01443         "Return UTC time tuple compatible with time.gmtime()."
01444         offset = self.utcoffset()
01445         if offset:
01446             self -= offset
01447         y, m, d = self.year, self.month, self.day
01448         hh, mm, ss = self.hour, self.minute, self.second
01449         return _build_struct_time(y, m, d, hh, mm, ss, 0)

Here is the call graph for this function:

def datetime.date.weekday (   self) [inherited]

Definition at line 865 of file datetime.py.

00865 
00866     def weekday(self):
00867         "Return day of the week, where Monday == 0 ... Sunday == 6."
00868         return (self.toordinal() + 6) % 7

Here is the call graph for this function:

def datetime.date.year (   self) [inherited]
year (1-9999)

Definition at line 760 of file datetime.py.

00760 
00761     def year(self):
00762         """year (1-9999)"""
00763         return self._year

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1384 of file datetimetester.py.


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