[Zope-Checkins] CVS: Zope/lib/python/DateTime - DateTime.txt:1.1.2.1 DateTime.py:1.79.4.3

Chris McDonough chrism@zope.com
Fri, 3 Jan 2003 01:31:21 -0500


Update of /cvs-repository/Zope/lib/python/DateTime
In directory cvs.zope.org:/tmp/cvs-serv26635

Modified Files:
      Tag: chrism-install-branch
	DateTime.py 
Added Files:
      Tag: chrism-install-branch
	DateTime.txt 
Log Message:
Merging chrism-install-branch with HEAD (hopefully for one of the last
times).



=== 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


=== Zope/lib/python/DateTime/DateTime.py 1.79.4.2 => 1.79.4.3 ===
--- Zope/lib/python/DateTime/DateTime.py:1.79.4.2	Sun Nov 24 18:35:25 2002
+++ Zope/lib/python/DateTime/DateTime.py	Fri Jan  3 01:30:48 2003
@@ -15,7 +15,7 @@
 __version__='$Revision$'[11:-2]
 
 
-import re,sys, os, math,  DateTimeZone
+import re, math,  DateTimeZone
 from time import time, gmtime, localtime, asctime
 from time import daylight, timezone, altzone, strftime
 from types import InstanceType,IntType,FloatType,StringType,UnicodeType