is one of the modules in the
mx package made available by eGenix GmbH.
mx is open source, and at the time of this
mx.DateTime has liberal license
conditions similar to those of Python itself.
mx.DateTime’s popularity stems
from its functional richness and cross-platform portability. I
present only an essential subset of
mx.DateTime’s rich functionality
here; the module comes with detailed documentation about its advanced
time and date handling features.
DateTime supplies several date and time
types whose instances are immutable (and therefore suitable as
dictionary keys). Type
DateTime represents a time
instant and includes an absolute date, which is the number of days
since an epoch of January 1, year 1 CE, according to the Gregorian
calendar (0001-01-01 is day
1), and an absolute
time, which is a floating-point number of seconds since midnight.
DateTimeDelta represents an interval of
elapsed time, which is a floating-point number of seconds. Class
RelativeDateTime lets you specify dates in
relative terms, such as “next
Monday” or “first day of next
DateTimeDelta are covered in detail later in this
Date and time types supply customized string conversion, invoked via
str or automatically during implicit
conversion (e.g., in a