[Zope-Checkins] CVS: Zope/lib/python/DateTime - DateTime.txt:1.1 DateTime.html:NONE
Andreas Jung
andreas@andreas-jung.com
Thu, 19 Dec 2002 15:24:11 -0500
Update of /cvs-repository/Zope/lib/python/DateTime
In directory cvs.zope.org:/tmp/cvs-serv25754
Added Files:
DateTime.txt
Removed Files:
DateTime.html
Log Message:
changed DateTime docs from HTML to plain ascii
=== Added File Zope/lib/python/DateTime/DateTime.txt === (450/550 lines abridged)
DateTime
Encapsulation of date/time values
Module Functions
Timezones()
Return the list of recognized timezone names
Class DateTime
DateTime objects represent instants in time and provide interfaces for
controlling its representation without affecting the absolute value of the
object.
DateTime objects may be created from a wide variety of string or numeric data,
or may be computed from other DateTime objects. DateTimes support the ability
to convert their representations to many major timezones, as well as the
ablility to create a DateTime object in the context of a given timezone.
DateTime objects provide partial numerical behavior:
* Two date-time objects can be subtracted to obtain a time, in days between
the two.
* A date-time object and a positive or negative number may be added to obtain
a new date-time object that is the given number of days later than the
input date-time object.
* A positive or negative number and a date-time object may be added to obtain
a new date-time object that is the given number of days later than the
input date-time object.
* A positive or negative number may be subtracted from a date-time object to
obtain a new date-time object that is the given number of days earlier than
the input date-time object.
DateTime objects may be converted to integer, long, or float numbers of days
since January 1, 1901, using the standard int, long, and float functions
(Compatibility Note: int, long and float return the number of days since 1901
in GMT rather than local machine timezone). DateTime objects also provide
access to their value in a float format usable with the python time module,
provided that the value of the object falls in the range of the epoch-based
time module.
A DateTime object should be considered immutable; all conversion and numeric
operations return a new DateTime object rather than modify the current object.
Constructor For DateTime
[-=- -=- -=- 450 lines omitted -=- -=- -=-]
str(aDateTime)
Convert a DateTime to a string.
cmp(aDateTime, other)
Compare a DateTime with another DateTime object, or a float such as
those returned by time.time().
NOTE: __cmp__ support is provided for backward compatibility only, and
mixing DateTimes with ExtensionClasses could cause __cmp__ to break.
You should use the methods lessThan, greaterThan, lessThanEqualTo,
greaterThanEqualTo, equalTo and notEqualTo to avoid potential problems
later!!
hash(aDateTime)
Compute a hash value for a DateTime
Numeric Services Provided by DateTime
aDateTime + other
A DateTime may be added to a number and a number may be added to a
DateTime; two DateTimes cannot be added.
aDateTime - other
Either a DateTime or a number may be subtracted from a DateTime,
however, a DateTime may not be subtracted from a number.
other + aDateTimeAdd aDateTime to other.
A DateTime may be added to a number and a number may be added to a
DateTime; two DateTimes cannot be added.
int(aDateTime)
Convert to an integer number of days since Jan. 1, 1901 (gmt)
long(aDateTime)
Convert to a long-int number of days since Jan. 1, 1901 (gmt)
float(aDateTime)
Convert to floating-point number of days since Jan. 1, 1901 (gmt)
-------------------------------------------------------------------------------
Last Modified: 14 March 1997
=== Removed File Zope/lib/python/DateTime/DateTime.html ===