Creating time objects

You can instantiate time objects from the datetime class. A time object represents a time (hour, minute (required) second, microsecond (default to zero) tzinfo (default to None) fold (keyword only, default to zero).

Syntax
(class) time(hour: int, minute: int, second: int, microsecond: int, tzinfo: _TzInfo | None, fold: int)

Example 1

import datetime

t =  datetime.time(10, 20, 5)
print(t)
Output
10:20:05

Example 2

from datetime import time

t1 = time(10, 20, 30)
t2 = time(12, 8, 9).replace(5, 3, 44)
# Return the time formatted according to ISO.
t3 = time(21, 6, 3).isoformat() + "Z"

print(t1)
print(t2)
print(t3)
Output
10:20:30
05:03:44
21:06:03Z