How To Install python-egenix-mxdatetime on Ubuntu 18.04

In this tutorial we learn how to install python-egenix-mxdatetime on Ubuntu 18.04. python-egenix-mxdatetime is date and time handling routines for Python

Introduction

In this tutorial we learn how to install python-egenix-mxdatetime on Ubuntu 18.04.

What is python-egenix-mxdatetime

python-egenix-mxdatetime is:

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 1970-01-01 00:00: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 at hand to greatly simplify dealing with dates and times in real-world applications.

In addition to providing an easy-to-use Python interface the package also exports a comfortable C API interface for other extensions to build upon. This is especially interesting for database applications which often have to deal with date/time values (the mxODBC package is one example of an extension using this interface).

mxDateTime can convert between various different date/time storage formats, including COM dates, TJD, MJD, JDN, tuples and, probably most important, strings.

The date/time parser included in mxDateTime is one of the most flexible such parser available for Python. It is constantly being improved to make parsing date/time strings as easy as possible. At the same time, it offers a fully customizable interface which allows selecting valid date/time formats from a range of predefined categories.

There are also special parser and formatter modules for ARPA and ISO date/time formats, which are handy if you work a lot with Internet standards.

There are three methods to install python-egenix-mxdatetime on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-egenix-mxdatetime Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-egenix-mxdatetime using apt-get by running the following command:

sudo apt-get -y install python-egenix-mxdatetime

Install python-egenix-mxdatetime Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-egenix-mxdatetime using apt by running the following command:

sudo apt -y install python-egenix-mxdatetime

Install python-egenix-mxdatetime Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-egenix-mxdatetime using aptitude by running the following command:

sudo aptitude -y install python-egenix-mxdatetime

How To Uninstall python-egenix-mxdatetime on Ubuntu 18.04

To uninstall only the python-egenix-mxdatetime package we can use the following command:

sudo apt-get remove python-egenix-mxdatetime

Uninstall python-egenix-mxdatetime And Its Dependencies

To uninstall python-egenix-mxdatetime and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python-egenix-mxdatetime

Remove python-egenix-mxdatetime Configurations and Data

To remove python-egenix-mxdatetime configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-egenix-mxdatetime

Remove python-egenix-mxdatetime configuration, data, and all of its dependencies

We can use the following command to remove python-egenix-mxdatetime configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-egenix-mxdatetime

References

Summary

In this tutorial we learn how to install python-egenix-mxdatetime package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.