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

Type Date

object --+    
         |    
      date --+
             |
            Date


The Picalo date type to represent dates.
Method Summary
  __new__(*args, **kargs)
Date objects can be created in many different ways: (Static method)
  __reduce_ex__(self, pickle_protocol)
Helps in saving and loading the object
    Inherited from date
  __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
  ctime(...)
Return ctime() style string.
  isocalendar(...)
Return a 3-tuple containing ISO year, week number, and weekday.
  isoformat(...)
Return string in ISO 8601 format, YYYY-MM-DD.
  isoweekday(...)
Return the day of the week represented by the date.
  replace(...)
Return date with new specified fields.
  strftime(...)
format -> strftime() style string.
  timetuple(...)
Return time tuple, compatible with time.localtime().
  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
  fromordinal(...)
int -> date corresponding to a proleptic Gregorian ordinal.
  fromtimestamp(...)
timestamp -> local date from a POSIX timestamp (like time.time()).
  today(...)
Current date or datetime: same as self.__class__.fromtimestamp(time.time()).

Class Variable Summary
    Inherited from date
getset_descriptor day = <attribute 'day' of 'datetime.date' objects>
date max = datetime.date(9999, 12, 31)
date min = datetime.date(1, 1, 1)
getset_descriptor month = <attribute 'month' of 'datetime.date' objects>
timedelta resolution = datetime.timedelta(1)
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)

Date objects can be created in many different ways:

Option 1: No arguments for now.
  • Date()
Option 2: Provide the individual parts as numbers. The year is the only one that is absolutely necessary.
  • Date(year, month, day, hour, minute, second)
  • Date(year, month, day)
  • Date(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.
  • Date('2010-01-31', '%Y-%m-%d')
Option 4: Converts a string using ISO 8601 date format or a few other common formats
  • Date('2010-01-31')
  • Date('10-01-31')
  • Date('01-31-2010')
  • Date('2010 01 31')
  • Date('10 01 31')
  • Date('01 31 2010')
  • Date('2010.01.31')
  • Date('10.01.31')
  • Date('01.31.2010')
  • Date('2010/01/31')
  • Date('10/01/31')
  • Date('01/31/2010')
  • Date('2010-Jan-01')
  • Date('25 JAN 2005')
  • Date('25 Jan 2010')
  • Date('25 January 2005')
  • Date('2010-January-01')
  • Date('January 1, 2010')
  • Date('Jan 1, 2010')
Time can be specified with any of the above formats with hh:mm:ss, as in
  • Date('2010-01-31 14:15:25')
  • Date('2010-01-31 02:15:25am')
  • Date('2010-01-31 02:15:25 am')
but with the Date() function, the time information is ignored. Use DateTime if you want to keep time information as well.
Overrides:
datetime.date.__new__

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