Python date.today() Method

Beginner
6 min read
Updated: Nov 2026
3 examples
classmethod

Definition

date.today() returns the current local date as a date object with only year, month, and day. It is the same as date.fromtimestamp(time.time()).

datetime.today() also exists because datetime inherits from date; it returns the current local date and time as a naive datetime, like now() with no argument. Neither version accepts a time zone.

date.today() is a classmethod of datetime.date: call it on the class itself, as date.today(...), and it returns a new object. Import the class first, for example from datetime import date. The datetime class has a method with the same name.

Syntax

Call it on the date class (or on datetime to include the time).

python
day = date.today()
moment = datetime.today()
CallWhat it does
date.today()Gives the current local date, for example a date that prints as 2026-11-19.
datetime.today()Gives the current local date and time as a naive datetime.
date.today() - timedelta(days=7)Gives the date one week ago; arithmetic with timedelta returns a new date.

For the current date in UTC, which can differ from the local date near midnight, use datetime.now(timezone.utc).date().

Method signatures
python
classmethod date.today()
# returns: date (current local date)
classmethod datetime.today()
# returns: naive datetime (current local date and time)

Parameters

today() takes no parameters. If you need a time zone, call datetime.now(tz) instead.

Return Value

Return ValueDescription
dateFrom date.today(): the current local calendar day.
datetimeFrom datetime.today(): the current local date and time, naive.

Python Examples

Example 1 — Compare date.today() and datetime.today()

Call both versions and look at what each returns. Only stable facts are printed, not the date itself.

python
from datetime import date, datetime

d = date.today()
dt = datetime.today()

print(type(d).__name__, type(dt).__name__)
print(dt.tzinfo)
print(d <= dt.date())
print(hasattr(d, "hour"), hasattr(dt, "hour"))

How It Works

  1. Two classes, one name. date.today() builds a date, while datetime.today() builds a datetime because the classmethod creates an instance of the class it is called on.
  2. Naive result. datetime.today() has no zone, so tzinfo prints None.
  3. Order of calls. d was read first, so it is never after the date part of dt; the comparison prints True.
  4. No clock fields. A date has no hour attribute; only the datetime does.

Example 2 — Write an Age Function That Accepts a Fixed Date

Let the caller pass the reference day and use date.today() only as a fallback. Fixed dates make the results checkable.

python
from datetime import date


def age_on(birthday, today=None):
    today = today or date.today()
    had_birthday = (today.month, today.day) >= (birthday.month, birthday.day)
    return today.year - birthday.year - (not had_birthday)


born = date(1990, 7, 20)
print(age_on(born, date(2024, 7, 19)))
print(age_on(born, date(2024, 7, 20)))
print(age_on(born) >= 34)

How It Works

  1. Default to today. today or date.today() reads the clock only when the caller did not pass a date.
  2. Tuple comparison. (month, day) pairs compare element by element, so (7, 19) is before the birthday (7, 20).
  3. Bool as int. not had_birthday is True (1) the day before the birthday, giving 33, and False (0) on the day itself, giving 34.
  4. Live call stays stable. With the real date, the person is at least 34, so the last line prints True.

Example 3 — Build Tomorrow and Last Week from Today

Add and subtract timedelta values. The printed numbers are differences, so they do not change with the date.

python
from datetime import date, timedelta

today = date.today()
tomorrow = today + timedelta(days=1)
week_ago = today - timedelta(weeks=1)

print((tomorrow - today).days)
print((today - week_ago).days)
print(tomorrow.toordinal() - today.toordinal())
print(date(2000, 1, 1) < today < date(9999, 1, 1))

How It Works

  1. Date plus duration. today + timedelta(days=1) returns a new date; month and year boundaries are handled for you.
  2. Date minus date. Subtracting two dates gives a timedelta, and its .days attribute is a plain int.
  3. Day numbers agree. toordinal() numbers consecutive days, so tomorrow is exactly one more.
  4. Chained comparison. a < today < b checks both bounds at once and is True for any current date.

Frequently Asked Questions

Use from datetime import date and then date.today(). Print it, or call isoformat(), to get text like 2026-11-19.
date.today() returns only the date. datetime.now() returns the date and the time, and it accepts a tz argument for an aware result.
Use datetime.now(timezone.utc).date(). date.today() always uses the local time zone of the machine.
Subtract one day: date.today() - timedelta(days=1). The result is a new date object.
Call date.today().strftime("%d/%m/%Y").

Next: date.toordinal()

Return the proleptic Gregorian day number, where 0001-01-01 is day 1.

toordinal() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful