# Parts of a Date: .dt

Once a column holds dates, .dt gives its parts for every row at once, such as year, month, day_name(), hour and date, so you can count by weekday or hour, and subtracting two dates gives a Timedelta, the gap between them, whose .dt.days counts whole days.

![Cheat sheet: Parts of a Date: .dt](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/5f595d66bf0a4f2aad8ae41d8e3069fc.webp)

- Category: Data Analysis
- Level: Apprentice
- Tags: dt accessor, python, Timedelta, Timestamp
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/pandas-dt-accessor-cheat-sheet
