Module datetime :: Class datetime
[show private | hide private]
[frames | no frames]

Type datetime

object --+    
         |    
      date --+
             |
            datetime

Known Subclasses:
Timecode, Timecode

datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints or longs.
Method Summary
  __add__(x, y)
x.__add__(y) <==> x+y
  __eq__(x, y)
x.__eq__(y) <==> x==y
  __ge__(x, y)
x.__ge__(y) <==> x>=y
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __gt__(x, y)
x.__gt__(y) <==> x>y
  __hash__(x)
x.__hash__() <==> hash(x)
  __le__(x, y)
x.__le__(y) <==> x<=y
  __lt__(x, y)
x.__lt__(y) <==> x<y
  __ne__(x, y)
x.__ne__(y) <==> x!=y
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __radd__(x, y)
x.__radd__(y) <==> y+x
(cls, state) __reduce__()
__reduce__() -> (cls, state)
  __repr__(x)
x.__repr__() <==> repr(x)
  __rsub__(x, y)
x.__rsub__(y) <==> y-x
  __str__(x)
x.__str__() <==> str(x)
  __sub__(x, y)
x.__sub__(y) <==> x-y
  astimezone(...)
tz -> convert to local time in new timezone tz
  ctime(...)
Return ctime() style string.
  date(...)
Return date object with same year, month and day.
  dst(...)
Return self.tzinfo.dst(self).
  isoformat(...)
[sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM].
  replace(...)
Return datetime with new specified fields.
  time(...)
Return time object with same time but with tzinfo=None.
  timetuple(...)
Return time tuple, compatible with time.localtime().
  timetz(...)
Return time object with same time and tzinfo.
  tzname(...)
Return self.tzinfo.tzname(self).
  utcoffset(...)
Return self.tzinfo.utcoffset(self).
  utctimetuple(...)
Return UTC time tuple, compatible with time.localtime().
    Inherited from date
  isocalendar(...)
Return a 3-tuple containing ISO year, week number, and weekday.
  isoweekday(...)
Return the day of the week represented by the date.
  strftime(...)
format -> strftime() style string.
  toordinal(...)
Return proleptic Gregorian ordinal.
  weekday(...)
Return the day of the week represented by the date.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
    Inherited from type
  combine(...)
date, time -> datetime with same date and time fields
  fromordinal(...)
int -> date corresponding to a proleptic Gregorian ordinal.
  fromtimestamp(...)
timestamp[, tz] -> tz's local time from POSIX timestamp.
  now(...)
[tz] -> new datetime with tz's local day and time.
  today(...)
Current date or datetime: same as self.__class__.fromtimestamp(time.time()).
  utcfromtimestamp(...)
timestamp -> UTC datetime from a POSIX timestamp (like time.time()).
  utcnow(...)
Return a new datetime representing UTC day and time.

Class Variable Summary
getset_descriptor hour = <attribute 'hour' of 'datetime.datetime' objects>
datetime max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999...
getset_descriptor microsecond = <attribute 'microsecond' of 'datetime.date...
datetime min = datetime.datetime(1, 1, 1, 0, 0)
getset_descriptor minute = <attribute 'minute' of 'datetime.datetime' obje...
timedelta resolution = datetime.timedelta(0, 0, 1)
getset_descriptor second = <attribute 'second' of 'datetime.datetime' obje...
getset_descriptor tzinfo = <attribute 'tzinfo' of 'datetime.datetime' obje...
    Inherited from date
getset_descriptor day = <attribute 'day' of 'datetime.date' objects>
getset_descriptor month = <attribute 'month' of 'datetime.date' objects>
getset_descriptor year = <attribute 'year' of 'datetime.date' objects>

Method Details

__add__(x, y)
(Addition operator)

x.__add__(y) <==> x+y
Returns:
x+y
Overrides:
datetime.date.__add__

__eq__(x, y)
(Equality operator)

x.__eq__(y) <==> x==y
Returns:
x==y
Overrides:
datetime.date.__eq__

__ge__(x, y)
(Greater-than-or-equals operator)

x.__ge__(y) <==> x>=y
Returns:
x>=y
Overrides:
datetime.date.__ge__

__getattribute__(...)

x.__getattribute__('name') <==> x.name
Overrides:
datetime.date.__getattribute__

__gt__(x, y)
(Greater-than operator)

x.__gt__(y) <==> x>y
Returns:
x>y
Overrides:
datetime.date.__gt__

__hash__(x)
(Hashing function)

x.__hash__() <==> hash(x)
Returns:
hash(x)
Overrides:
datetime.date.__hash__

__le__(x, y)
(Less-than-or-equals operator)

x.__le__(y) <==> x<=y
Returns:
x<=y
Overrides:
datetime.date.__le__

__lt__(x, y)
(Less-than operator)

x.__lt__(y) <==> x<y
Returns:
x<y
Overrides:
datetime.date.__lt__

__ne__(x, y)

x.__ne__(y) <==> x!=y
Returns:
x!=y
Overrides:
datetime.date.__ne__

__new__(T, S, ...)

T.__new__(S, ...) -> a new object with type S, a subtype of T
Returns:
a new object with type S, a subtype of T
Overrides:
datetime.date.__new__

__radd__(x, y)
(Right-side addition operator)

x.__radd__(y) <==> y+x
Returns:
y+x
Overrides:
datetime.date.__radd__

__reduce__()

__reduce__() -> (cls, state)
Returns:
(cls, state)
Overrides:
datetime.date.__reduce__

__repr__(x)
(Representation operator)

x.__repr__() <==> repr(x)
Returns:
repr(x)
Overrides:
datetime.date.__repr__

__rsub__(x, y)

x.__rsub__(y) <==> y-x
Returns:
y-x
Overrides:
datetime.date.__rsub__

__str__(x)
(Informal representation operator)

x.__str__() <==> str(x)
Returns:
str(x)
Overrides:
datetime.date.__str__

__sub__(x, y)
(Subtraction operator)

x.__sub__(y) <==> x-y
Returns:
x-y
Overrides:
datetime.date.__sub__

astimezone(...)

tz -> convert to local time in new timezone tz

ctime(...)

Return ctime() style string.
Overrides:
datetime.date.ctime

date(...)

Return date object with same year, month and day.

dst(...)

Return self.tzinfo.dst(self).

isoformat(...)

[sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM].

sep is used to separate the year from the time, and defaults to 'T'.
Overrides:
datetime.date.isoformat

replace(...)

Return datetime with new specified fields.
Overrides:
datetime.date.replace

time(...)

Return time object with same time but with tzinfo=None.

timetuple(...)

Return time tuple, compatible with time.localtime().
Overrides:
datetime.date.timetuple

timetz(...)

Return time object with same time and tzinfo.

tzname(...)

Return self.tzinfo.tzname(self).

utcoffset(...)

Return self.tzinfo.utcoffset(self).

utctimetuple(...)

Return UTC time tuple, compatible with time.localtime().

Class Variable Details

hour

Type:
getset_descriptor
Value:
<attribute 'hour' of 'datetime.datetime' objects>                      

max

Type:
datetime
Value:
datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)                    

microsecond

Type:
getset_descriptor
Value:
<attribute 'microsecond' of 'datetime.datetime' objects>               

min

Type:
datetime
Value:
datetime.datetime(1, 1, 1, 0, 0)                                       

minute

Type:
getset_descriptor
Value:
<attribute 'minute' of 'datetime.datetime' objects>                    

resolution

Type:
timedelta
Value:
datetime.timedelta(0, 0, 1)                                            

second

Type:
getset_descriptor
Value:
<attribute 'second' of 'datetime.datetime' objects>                    

tzinfo

Type:
getset_descriptor
Value:
<attribute 'tzinfo' of 'datetime.datetime' objects>                    

Generated by Epydoc 2.1 on Thu Oct 20 15:30:30 2005 http://epydoc.sf.net