A date may be any date (including forever into the past and forever into the future).
A date is assumed to be immutable - multiple entities may safely refer to the same date. For this reason, there are no "set" methods.
Public data members:
Internal representation of the date - seconds since the beginning of the epoch. Don't modify this.
This attribute used to contain the internal representation, but now it is a pseudo-attribute: it is computed upon demand.
This class includes a number of class variables for symbolic constants: sunday, monday, tuesday, wednesday, thursday, friday, saturday, january, february, march, april, may, june, july, august, september, october, november, december.
def __add__(self, days):
Returns a new date consisting of the given date plus days.
Allows us to use the comparison operators on dates.
returns the current date, which is the current time truncated of all
precision greater than the day.
Provides the transparent computation of the time attribute.
Allows conversion from old-style representation.
Returns the date formatted in the new standard format.
Returns the difference (in days) between two dates. A day is assumed to be
86400 seconds.
If other is not a date, but is a number, a new date is returned that
is other days before self.
Returns a year/month/day tuple for the localtime represented by t.
Returns the localtime representation of the date.
Returns true if daylight savings time is in effect for this date, false if
not.
Returns the date and time formated using the strftime function.
Returns a string consisting of the receiver formatted as mm/dd/yyyy
Returns a string consisting of the receiver formatted as mmddyy
Returns a string consisting of the receiver formatted as mm/dd/yy
Returns the day of the month.
Returns the current day of the week as a number.
Returns the month
Returns the year.
Returns a new date which is the given weekday immediately prior to the
date of self. If selfs date falls on that weekday, returns a copy
of self.
Returns a new date which is the given weekday following the date of
self. If selfs date falls on that weekday, returns a copy of
self.
Returns a tuple consisting of the year, month, and day.
__cmp__(self, other)
def __cmp__(self, other):
__currentDate(self)
def __currentDate(self):
__getattr__(self, attr)
def __getattr__(self, attr):
__init__(self, time, stdfmt, other, year, month, day, foreverPast, foreverFuture, now)
def __init__(self, time = 0, stdfmt = "", other = None, year = 0,
month = 0, day = 0, foreverPast = 0, foreverFuture = 0,
now = 0
):
__setstate__(self, dict)
def __setstate__(self, dict):
__str__(self)
def __str__(self):
__sub__(self, other)
def __sub__(self, other):
__timeToDate(self, t)
def __timeToDate(self, t):
_toTime(self)
def _toTime(self):
dst(self)
def dst(self):
format(self, formatStr)
def format(self, formatStr):
formatNewStd(self)
def formatNewStd(self):
formatShort(self)
def formatShort(self):
formatStd(self)
def formatStd(self):
getDay(self)
def getDay(self):
getDayOfWeek(self)
def getDayOfWeek(self):
getMonth(self)
def getMonth(self):
getYear(self)
def getYear(self):
last(self, weekday)
def last(self, weekday):
next(self, weekday)
def next(self, weekday):
ymd(self)
def ymd(self):