[DB-SIG] ANN: DateTime package version 0.7

M.-A. Lemburg lemburg@uni-duesseldorf.de
Wed, 25 Feb 1998 12:37:37 +0100


I have uploaded a new version of the DateTime package to
starship. It fixes a few minor problems. The interface is
quite stable now. Please try it and report any bugs you find:

   http://starship.skyport.net/~lemburg/mxDateTime.html

I would also like to make a DLL for Windows available but
have yet to find someone willing to do the necessary setup
(should be easy) and compilation.

>From the change list:

To make the transition from usage of time values to usage of the
new types easier, they can convert themselves to floats and integers
on demand (e.g. with float() or int()). The DateTime instances return
their value in ticks, the DateTimeDelta instances in seconds. The
necessary conversion can cause a ConversionError to be raised in case
the objects value doesn't fit into the converted types range.

Since it is sometimes needed to have the date/time value stored in
one number (begin sufficiently accurate to hold a vast range of
dates), interfaces to both types were added that return the internal
value as days Python float (maps to a C double). The fraction part is
calculated using a 86400.0 seconds/day basis and does not account for
leap seconds.

Fixed a bug in the value of the constant Epoch. The epoch for this
module is 1.1.0001 0:00:00.00 and not 1.1.0001 0:00:01.00.

Added code from Modules/timemodule.c (found in the 1.5 Python
distribution) that allows now() to return fractions of a second.

Added __members__ attribute to both types.

The module now defines a cleanup function which it registers
with Py_AtExit(). This will free the free lists upon finalization
of the interpreter.

Added #ifdefs and #defines to make the module more portable
to platforms which don't provide the C lib functions strftime()
and strptime(). These interfaces are only available on platforms
which provide the corresponding C functions. <I>You may have to
enable them manually (see mxDateTime.c) on platforms other than
Unix.</I>

When converting the date/time values to the representation used by
the C API strftime(), seconds are now rounded to the next integer (the
struct tm defines second as being an integer, thus fraction parts can
not be displayed).

Changed the default date/time representation for str() and repr()
to ISO format. I previously used the strftime() C-API but that has the
disadvantage of not displaying fractions of a second which can lead to
representations off by up to 0.5 seconds.

The second attributes of both types now return floats instead
of integers.

Enjoy !

-- 
Marc-Andre Lemburg


_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________