| |
- Date
class Date |
|
A module for date representation. Can do comparisons,
increments/decrements, string output. Its functions are not to
be trusted with parameters. |
|
Methods defined here:
- __cmp__(self, y)
- __init__(self, month=None, day=None, year=None, datestring=None, longdatestring=None)
- Creates a new date using (first) three integers month, date,
and year respectively, (second) a string datestring of the
format MM-DD-YYYY, or (third) a string longdatestring of the in
such format as "April 29th, 1992". If neither three integers nor
a datestring nor a longdatestring are provided, the new object's
date is set to today.
- __str__(self)
- Returns the string representation of the string in the format
Month Date, Year, eg "January 1,1982
- add_days(self, increment=1)
- Function that returns a new date instance after increment
number of days have been added to this instance
- changeMonthDec(self)
- Helper method that takes in no arguments and specifies if
decrementing this instance by one day would change its month
- changeMonthInc(self)
- Helper method that takes in no arguments and specifies if
incrementing this instance by one day would change its month
- changeYearDec(self)
- Helper method that takes in no arguments and specifies if
decrementing this instance by one day would change its year
- changeYearInc(self)
- Helper method that takes in no arguments and specifies if
incrementing this instance by one day would change its year
- isLeapYear(self, year)
- Function used to determine year is a leap year
- next_day(self)
- Function that returns a new date instance that is one day
ahead of the instance calling it
- prev_day(self)
- Function that returns a new date instance that is one day
before the instance calling it
- sub_days(self, decrement=1)
- Function that returns a new date instance after decrement
number of days have been subtracted from this instance
Data and non-method functions defined here:
- __doc__ = ' A module for date representation. Can do comp... are not to\n be trusted with parameters.'
- __module__ = 'hunter'
| |