# datetime Module

say it: **“DAYT-tym MOJ-ool”** **/ˈdeɪttaɪm ˈmɒdʒuːl/**

A standard module for working with dates and times.

## What is the `datetime` module?

The `datetime` module works with dates and times: today's date, how many days until an event, formatting a date for a receipt.

```python
from datetime import date
trip = date(2026, 12, 20)
days_left = (trip - date.today()).days
print(f"{days_left} days until the trip")
```

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/datetime-module
