How to Get the Date from a datetime in Python with .date()
A datetime holds a date and a time, such as 2026-12-01 03:54:45. Often you only want the day: to name a file, to compare days, or to ask an API for one day's data. The .date() method gives you that part. This guide uses it on Python 3.15.2.
Syntax
<datetime>.date()
| Part | What it means |
|---|---|
<datetime> | Any datetime object, such as the one datetime.now(UTC) returns |
.date() | Returns a new date object with only the year, month and day. The datetime itself doesn't change |
Python's datetime documentation describes it in one line: "Return date object with same year, month and day."
The Example
The script takes the current moment in UTC, keeps only its date, and prints both, plus the type of the result.
Prerequisites
- uv and Python 3. This guide uses uv 0.13.10 with Python 3.15.2, in a project made with
uv init.
Step 1: Write the Script
from datetime import UTC, datetime
now = datetime.now(UTC)
today = now.date()
print(now)
print(today)
print(type(today).__name__)

UTC is Python's name for the UTC time zone, so now is the current time in UTC rather than in your computer's time zone.
Step 2: Run It
uv run python date_part.py
2026-12-01 03:54:45.803992+00:00
2026-12-01
date

The first line is the whole datetime, with its time and its +00:00 offset. The second is the same moment cut down to its date. The third shows that .date() returned a date, a different type from datetime. Your first two lines show the moment you run it. The command works unchanged in PowerShell.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Leaving out the brackets: now.date | Python prints the method itself, <built-in method date of datetime.datetime object at 0x103547b10>, instead of a date | Call it: now.date() |
Using date.today() when you need UTC | date.today() returns "the current local date", in Python's words: your computer's time zone, which can be a different day from UTC around midnight | Take the date from a UTC datetime: datetime.now(UTC).date() |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
The output says <built-in method date of ...> | The brackets after date are missing | Add () |
| The date is one day off from what a server or API shows | One side uses local time and the other UTC | Use UTC on both sides |
FAQ
Does .date() change the original datetime?
No. It returns a new date and leaves now as it was: the script printed the full now after calling .date().
How do I get the time part instead?
Use .time(). The same page lists it right after .date().
Conclusion
datetime.now(UTC).date() turned 2026-12-01 03:54:45.803992+00:00 into 2026-12-01, a date object with no time and no time zone. Use it whenever only the day matters.
Additional Resources
- datetime.date() — the method.
- date objects — what you can do with the result.
