Home | Trees | Indices | Help |
---|
|
A specific point in time, identified by year, month, day, hour, minute, second.
Python's datetime module calls this a "datetime".
|
|||
Time |
|
||
Time |
|
||
boolean |
|
||
boolean |
|
||
boolean |
|
||
boolean |
|
||
boolean |
|
||
boolean |
|
||
string |
|
||
Time or Period |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Period |
|
||
tuple |
|
||
tuple |
|
||
tuple |
|
||
tuple |
|
||
tuple |
|
||
tuple |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
string |
|
||
tuple |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
int |
|
||
string |
|
||
string |
|
||
int |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
string |
|
||
int |
|
||
string |
|
||
string |
|
||
tuple |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
int |
|
||
string |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
Time |
|
||
boolean |
|
||
Time |
|
||
Time |
|
|
|||
string |
civildate Return a string containing the civildate. |
||
tuple |
civiltimebase A utility method for other civiltime methods. |
||
string |
civiltime Return a string containing the civil time. |
||
string |
t Return a string containing the civil time. |
||
string |
civiltime2 Return a string containing the civil time (including seconds.) |
||
string |
t2 Return a string containing the civil time (including seconds.) |
||
string |
d Return a string containing the civildate. |
||
string |
dostime Return the datetime in the format used by Microsoft's MS-DOS. |
||
int |
day Return the day part of the datetime. |
||
string |
dt Return a string containing the civildate and the time, e.g. |
||
string |
dt2 Return a string containing the civildate and the time (including seconds) e.g. |
||
int |
hour Return the hour portion of the Time, as an int. |
||
string |
isodate Return a string containing an ISO date in format yyyy-mm-dd, e.g. |
||
string |
isotime Return a string containing ISO time in format hh:mm:ss, e.g. |
||
string |
isodatetime Return a string containing an ISO datetime in format yyyy-mm-ddThh:mm:ss. |
||
string |
isofilename Return a string containing the ISO datetime in a format suitable for making a filename. |
||
int |
isoweekday Return the ISO weekday number as an int, where Monday=1 .. |
||
int |
weekday Return the ISO weekday number as an int, where Monday=1 .. |
||
int |
weeknumber Return the ISO week number, as an int. |
||
int |
isoweeknumber Return the ISO week number, as an int. |
||
int |
minute Return the minute portion of a Time, as an int. |
||
int |
month Return the month portion of a Time, as an int. |
||
string |
monthname Return a string containing the natural language name of the month. |
||
string |
m Return a string containing the natural language name of the month. |
||
int |
second Return the second portion of a Time, as an int. |
||
string |
td Return a string containing the time and the civil date. |
||
string |
t2d Return a string containing the time and the civil date (including seconds). |
||
string |
twd Return a string containing the time, the weekday name, and the civildate. |
||
string |
t2wd Return a string containing the time (including seconds), the weekday name, and the civildate. |
||
string |
unixdate Return a string containing a Unix date, e.g. |
||
string |
weekdayname Returns the natural language name of the day of the week. |
||
string |
w Returns the natural language name of the day of the week. |
||
string |
wd Returns a string containing the weekday name and the civildate. |
||
string |
wdt Returns a string containing the weekday name, the civildate, and the time. |
||
string |
wdt2 Returns a string containing the weekday name, the civildate, and the time (including seconds). |
||
int |
year Return the year as an int, e.g. |
||
string |
y Return the year as a string, e.g. |
|
The constructor for a Time object. Constructor expects arguments of:
|
Return a string representation of self as an isodate + space + isotime
|
Subtract a Period or a Time from this Time object.
Notes:
|
A method to add time to a Time object. This is the basic method for doing date/time arithmetic. The units and amounts of time are specified as keyword arguments.
Notes:
|
A method to add time to a Time object. This is the basic method for doing date/time arithmetic. The units and amounts of time are specified as keyword arguments.
Notes:
|
A method for adding months to a time object. >>> t1 = Time(2004,1,31) >>> t1.d 'January 31, 2004' >>> t2 = t1.addmonths(1) >>> t2.d 'February 29, 2004' >>> t2 = t1.add(months=8) >>> t2.d 'September 30, 2004'
Note: You can use this method directly, e.g.: t = Time().addmonths(6) Or you can use the standard add() method: t = Time().add(months=6) |
The most recent anniversary of myself.
Note: In a non-leapyear, the anniversary of an event that occurred on February 29 of a leapyear will be moved to February 28. |
Return a clone of myself.
Note: It is possible to change certain parts of the cloned Time by using keyword arguments for the component(s) to be replaced in the clone. To make a clone of the current time, but one set in the year 1935, for example: t1 = Time() t2 = t1.clone(year=1935) Note that it is possible to trigger a ValueError, if for example:
If you *want* to raise a ValueError when such problems occur, use the clone() method. Otherwise, use the goto() method, which attempts to recover from such errors: t1 = Time() t2 = t1.goto(year=1935) |
Determine the difference (a Period) between two Times.
Note: Unlike the __sub__ method, the diff (i.e. difference) method always returns a Period object with a positive value. |
Determine the difference (a Period) between myself and the time of some event.
Note: returns the difference between two Time objects as a tuple of (years, Period) |
Determine the difference (a Period) between myself and the time of some event.
Note: returns the difference between two Time objects as a tuple of (years, Period) |
Determine the difference (a Period) between myself and the time of some event.
Note: returns the difference between two Time objects as a tuple of (years,months, Period) |
Determine the difference (a Period) between myself and the time of some event.
Note: returns the difference between two Time objects as a tuple of (years,months, Period) |
return a new Time object which has been moved so it does not fall on a Saturday or Sunday.
|
A method for adding days to a date, based on a base date. If the day-of-month of my time is less than the day-of-month of the baseTime, then calculate the number of days difference and add them to my time. This method is designed to be used when doing monthly arithmetic. In the following example, we add 1 month to January 31. Because February contains only 28 days, we get February 28. If we want to get the counterpart of January 31 in February (February 31, which resolves to March 3) we can "flex" the date based on the base date of January 31. >>> startDate = Time(2003,1,31) >>> startDate.d 'January 31, 2003' >>> startDate.add(months=1).d 'February 28, 2003' >>> startDate.add(months=1).flex(startDate).d 'March 3, 2003'
|
|
See Also: the datetime module for documentation |
Return a string containing the civildate.
|
A utility method for other civiltime methods.
|
Return a string containing the civil time. If keyword arg showseconds=True, time will include seconds. If keyword arg showHundredthsOfSeconds=True, time will include hundredths of seconds. Note that hundredths of seconds are faked to "00". This is primarily for MS-DOS timestamps which show hundredths of seconds, even though the clocks of PCs are not accurate to hundredths of seconds.
Note: Civil time as used in United States of America: midnight = 12:00am time between midnight and noon = am noon = 12:00pm time between noon and midnight = am |
Return a string containing the civil time (including seconds.)
|
Return a string containing the civildate.
|
Return the datetime in the format used by Microsoft's MS-DOS.
|
Return the day part of the datetime.
|
Return a string containing the civildate and the time, e.g. "April 30, 2007 6:30pm".
|
Return a string containing the civildate and the time (including seconds) e.g. "April 30, 2007 6:30:45pm".
|
Return the hour portion of the Time, as an int.
|
Return a string containing an ISO date in format yyyy-mm-dd, e.g. "2007-10-09"
|
Return a string containing ISO time in format hh:mm:ss, e.g. "11:15:00".
|
Return a string containing an ISO datetime in format yyyy-mm-ddThh:mm:ss.
|
Return a string containing the ISO datetime in a format suitable for making a filename.
Notes:
|
Return the ISO weekday number as an int, where Monday=1 .. Sunday=7
|
Return the ISO week number, as an int.
|
Return the minute portion of a Time, as an int.
|
Return the month portion of a Time, as an int.
|
Return a string containing the natural language name of the month.
|
Return the second portion of a Time, as an int.
|
Return a string containing the time and the civil date.
|
Return a string containing the time and the civil date (including seconds).
|
Return a tuple containing the parts of the datetime.
|
Return a string containing the time, the weekday name, and the civildate.
|
Return a string containing the time (including seconds), the weekday name, and the civildate.
|
Return a string containing a Unix date, e.g. "07-DEC-2006".
|
Returns the natural language name of the day of the week.
|
Returns a string containing the weekday name and the civildate.
|
Returns a string containing the weekday name, the civildate, and the time.
|
Returns a string containing the weekday name, the civildate, and the time (including seconds).
|
Return the year as an int, e.g. 2007
|
Return the year as a string, e.g. "2007"
|
Returns a clone of self but with some component(s) (year, month, day, hour, minute, second) reset to a new value.
Notes:
|
Returns a new Time object in which the month has been moved to the specified argMonth.
Notes:
|
Return a new Time object in which the time has been moved to the beginning of the month.
Note: Example: If today is May 15, 2007 then to obtain a time object whose date is May 1: t = Time().gotoMonthBegin() |
Return a new Time object in which the time has been moved to the end of the month.
Note: Example: If today is May 15, 2007 then to obtain a time object whose date is May 31: t = Time().gotoMonthEnd() |
Return a new Time object in which the time has been moved to the beginning of year.
Note: Example: If today is May 15, 2007 then to obtain a time object whose date is January 1, 2007: t = Time().gotoYearBegin() |
Return a new Time object in which the time has been moved to the end of the year.
Note: Example: If today is May 15, 2007 then to obtain a time object whose date is December 31, 2007: t = Time().gotoYearEnd() |
Return a new Time object in which the month has been moved (forward or backward) to the closest month with month number <month>.
Notes:
|
Return a new Time object in which the weekday has been moved (forward or backward) to the closest weekday with weekday number <weekday>.
Notes:
|
Return a new Time object in which the date has been moved to the specified argWeekday.
|
Return a boolean indicating whether the year is or is not a leap year.
|
Subtract some amounts of time from the current time. Syntactic sugar for cases in which you don't want to "add" negative amounts of time.
|
Subtract some amounts of time from the current time. Syntactic sugar for cases in which you don't want to "add" negative amounts of time.
|
|
civildateReturn a string containing the civildate.
|
civiltimebaseA utility method for other civiltime methods.
|
civiltimeReturn a string containing the civil time. If keyword arg showseconds=True, time will include seconds. If keyword arg showHundredthsOfSeconds=True, time will include hundredths of seconds. Note that hundredths of seconds are faked to "00". This is primarily for MS-DOS timestamps which show hundredths of seconds, even though the clocks of PCs are not accurate to hundredths of seconds.
Note: Civil time as used in United States of America: midnight = 12:00am time between midnight and noon = am noon = 12:00pm time between noon and midnight = am |
tReturn a string containing the civil time. If keyword arg showseconds=True, time will include seconds. If keyword arg showHundredthsOfSeconds=True, time will include hundredths of seconds. Note that hundredths of seconds are faked to "00". This is primarily for MS-DOS timestamps which show hundredths of seconds, even though the clocks of PCs are not accurate to hundredths of seconds.
Note: Civil time as used in United States of America: midnight = 12:00am time between midnight and noon = am noon = 12:00pm time between noon and midnight = am |
civiltime2Return a string containing the civil time (including seconds.)
|
t2Return a string containing the civil time (including seconds.)
|
dReturn a string containing the civildate.
|
dostimeReturn the datetime in the format used by Microsoft's MS-DOS.
|
dayReturn the day part of the datetime.
|
dtReturn a string containing the civildate and the time, e.g. "April 30, 2007 6:30pm".
|
dt2Return a string containing the civildate and the time (including seconds) e.g. "April 30, 2007 6:30:45pm".
|
hourReturn the hour portion of the Time, as an int.
|
isodateReturn a string containing an ISO date in format yyyy-mm-dd, e.g. "2007-10-09"
|
isotimeReturn a string containing ISO time in format hh:mm:ss, e.g. "11:15:00".
|
isodatetimeReturn a string containing an ISO datetime in format yyyy-mm-ddThh:mm:ss.
|
isofilenameReturn a string containing the ISO datetime in a format suitable for making a filename.
Notes:
|
isoweekdayReturn the ISO weekday number as an int, where Monday=1 .. Sunday=7
|
weekdayReturn the ISO weekday number as an int, where Monday=1 .. Sunday=7
|
weeknumberReturn the ISO week number, as an int.
|
isoweeknumberReturn the ISO week number, as an int.
|
minuteReturn the minute portion of a Time, as an int.
|
monthReturn the month portion of a Time, as an int.
|
monthnameReturn a string containing the natural language name of the month.
|
mReturn a string containing the natural language name of the month.
|
secondReturn the second portion of a Time, as an int.
|
tdReturn a string containing the time and the civil date.
|
t2dReturn a string containing the time and the civil date (including seconds).
|
twdReturn a string containing the time, the weekday name, and the civildate.
|
t2wdReturn a string containing the time (including seconds), the weekday name, and the civildate.
|
unixdateReturn a string containing a Unix date, e.g. "07-DEC-2006".
|
weekdaynameReturns the natural language name of the day of the week.
|
wReturns the natural language name of the day of the week.
|
wdReturns a string containing the weekday name and the civildate.
|
wdtReturns a string containing the weekday name, the civildate, and the time.
|
wdt2Returns a string containing the weekday name, the civildate, and the time (including seconds).
|
yearReturn the year as an int, e.g. 2007
|
yReturn the year as a string, e.g. "2007"
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Aug 30 08:52:50 2008 | http://epydoc.sourceforge.net |