.time()
BrandonDusch580 total contributions
Published Jun 7, 2022
Contribute to Docs
The datetime.time()
method returns a time in seconds that has passed since the epoch set on the computer.
Syntax
datetime.time(hour=0, minute=0, second=0, microsecond=0, tzinfo=None)
The epoch is usually set as January 1, 1970, 00:00:00 (UTC)
on most operating systems, excluding any leap seconds.
Codebyte Example
The time can be retrieved and stored in a variable as shown below:
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.