Package picalo :: Package base :: Module Calendar :: Class DateTime
[show private | hide private]
[frames | no frames]

Type DateTime

object --+        
         |        
      date --+    
             |    
      datetime --+
                 |
                DateTime


The Picalo date/time type to represent dates and times.
Method Summary
  __new__(*args, **kargs)
The Picalo date/time type to represent dates and times. (Static method)
  __reduce_ex__(self, pickle_protocol)
Helps in saving and loading the object
    Inherited from datetime
  __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
  __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
  __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
    Inherited from datetime
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>

Instance Method Details

__reduce_ex__(self, pickle_protocol)

Helps in saving and loading the object
Overrides:
__builtin__.object.__reduce_ex__

Static Method Details

__new__(*args, **kargs)

The Picalo date/time type to represent dates and times. DateTime objects can be created in many different ways:

Option 1: No arguments.
  • DateTime()
Option 2: Provide the individual parts as numbers. The year is the only one that is absolutely necessary.
  • DateTime(year, month, day, hour, minute, second)
  • DateTime(year, month, day)
  • DateTime(year)
Option 3: Converts a string using a custom format. Format options are described in the strftime manpage. Search the web for "strftime unix manpage" for the options.
  • DateTime('2010-01-31', '%Y-%m-%d')
Option 4: Converts a string using ISO 8601 date format or a few other common formats
  • DateTime('2010-01-31')
  • DateTime('10-01-31')
  • DateTime('01-31-2010')
  • DateTime('2010 01 31')
  • DateTime('10 01 31')
  • DateTime('01 31 2010')
  • DateTime('2010.01.31')
  • DateTime('10.01.31')
  • DateTime('01.31.2010')
  • DateTime('2010/01/31')
  • DateTime('10/01/31')
  • DateTime('01/31/2010')
  • DateTime('2010-Jan-01')
  • DateTime('25 JAN 2005')
  • DateTime('25 Jan 2010')
  • DateTime('25 January 2005')
  • DateTime('2010-January-01')
  • DateTime('January 1, 2010')
  • DateTime('Jan 1, 2010')
Time can be specified with any of the above formats with hh:mm:ss, as in
  • DateTime('2010-01-31 14:15:25')
  • DateTime('2010-01-31 02:15:25am')
  • DateTime('2010-01-31 02:15:25 am')
  • Time zone information is not supported with Option 4 at this point.
Overrides:
datetime.datetime.__new__

Generated by Epydoc 2.1 on Mon Aug 20 05:38:17 2007 http://epydoc.sf.net