datetime.combine(date, time) builds a new datetime whose year, month, and day come from the date and whose hour, minute, second, and microsecond come from the time.
The result copies the time's tzinfo, so an aware time gives an aware datetime. The optional tzinfo argument (Python 3.6+) overrides that zone. It is the reverse of splitting with date() and timetz().
datetime.combine() is a classmethod of datetime.datetime: call it on the class itself, as datetime.combine(...), and it returns a new object. Import the class first, for example from datetime import datetime.
Syntax
Pass a date, a time, and optionally a tzinfo.
python
moment = datetime.combine(date, time)
moment = datetime.combine(date, time, tzinfo=tz)
Gives midnight at the start of day d; time.min is 00:00.
If the first argument is a datetime, only its date part is used; its time and zone are ignored.
Method signatures
python
classmethod datetime.combine(date, time, tzinfo=time.tzinfo)
# date: a date (or datetime) object
# time: a time object
# tzinfo: optional, overrides the time's tzinfo (Python 3.6+)
Parameters
Parameter
Description
date
The calendar day, a date object.
time
The clock time, a time object.
tzinfo
Optional. The zone for the result; by default the time's own tzinfo.
Return Value
Return Value
Description
datetime
A new datetime made of the date fields and the time fields.
Python Examples
Example 1 — Join a Date and a Time
Combine a meeting day with a start time, check the weekday, and build midnight with time.min.
python
from datetime import date, datetime, time
meeting_day = date(2024, 9, 2)
start = time(14, 30)
moment = datetime.combine(meeting_day, start)
print(moment)
print(moment.weekday())
print(datetime.combine(meeting_day, time.min))
Output
2024-09-02 14:30:00
0
2024-09-02 00:00:00
How It Works
Two halves. The date supplies 2 September 2024 and the time supplies 14:30.
Full datetime. The result has every datetime method, such as weekday(), which returns 0 for Monday.
Start of day.time.min is time(0, 0), so the combination is midnight.
Example 2 — Control the Time Zone of the Result
An aware time passes its zone to the result. The tzinfo argument replaces it without changing the clock reading.
python
from datetime import date, datetime, time, timedelta, timezone
cet = timezone(timedelta(hours=1), "CET")
opening = time(9, 0, tzinfo=cet)
day = date(2025, 1, 20)
print(datetime.combine(day, opening))
print(datetime.combine(day, opening, tzinfo=timezone.utc))
print(datetime.combine(day, opening).astimezone(timezone.utc).time())