
mxDateTime™ is a Python extension package that provides three new objects, DateTime, DateTimeDelta and RelativeDateTime, which let you store and handle date/time values in a much more natural way than by using ticks (seconds since 1.1.1970 0:00 UTC), the representation used by Python's time module.
You can add, subtract and even multiply instances, pickle and copy them and convert the results to strings, COM dates,ticks and some other more esoteric values. In addition,there are several convenient constructors and formatters athand to greatly simplify dealing with dates and times inreal-world applications.
In addition to providing an easy-to-use Python interface thepackage also exports acomfortable C API interface for otherPython extensions to build upon. This is especially interesting fordatabase applications which often have to deal withdate/time values. ThemxODBC packageis an example of a Python extension using this interface.
mxDateTime can convert between various different date/time storage formats, includingCOM dates,TJD,MJD, JDN, tuples and, probably most important, strings.
Thedate/time parser included in mxDateTime isone of the most flexible such parsers available for Python. It isconstantly being improved to make parsing date/time strings as easy aspossible. At the same time, it offers a fully customizable interfacewhich allows selecting valid date/time formats from a range ofpredefined categories.
There are also special parser and formatter modules forARPA and ISO date/time formats, which are handy if you work a lot with Internet standards.
mxDateTime is written in a very portable way and works on pretty much all platforms where you can compile Python.
We provide precompiled versions of mxDateTime for all standardplatforms, so all you need is a working Python installation.
The only requirement for compiling the package from source is an ANSI C compiler. There are no third-party libraries needed.
mxDateTime is provided as part of the eGenix.com mx Base Distribution. Please see themx Base Distribution page for details regarding the license.
The following documentation is available for mxDateTime:
mxDateTime User Manual and Reference Guide -HTML andPDF
The manual includes a discussion of the designprinciples behind mxDateTime, its implementation, as well as areference of the available programming interfaces.
The PDF file is also available as part of the installation and can be found in themx/DateTime/Doc/folder.
"Python Programming On Win32" by Mark Hammond, Andy Robinson has a section on mxODBC and mxDateTime.
mxDateTime is provided as part of the eGenix.com mx Base Distribution. Please see themx Base Distribution page for downloads and installation instructions.
mxDateTimeisused in our mxODBC products and by quite a few other third-partydatabase modules. For many years it was the only alternative toPython's time module and is one ofthe recommended date/time implementations inPython's Database API Specification 2.0.
mxDateTime is also used throughout our own software products as well as many mission critical third-party applications, such as the popularOpenERP enterprise management suite.
Please see thechange log for details regarding changes to the package between releases.