Python has a built-in
time module that can be used for time related tasks. This module utilizes a number of different standards and objects that may be unfamiliar such as:
- The epoch refers to a reference point in time from which calculations can be made. It is designated as midnight on January 1, 1970.
- There are functions that will return values formatted using Daylight Savings Time (DST).
- There is a specific time data type called
The following functions are provided by this module.
- Takes a time, expressed in seconds elapsed since the epoch, and returns a formatted string.
- Suspends execution of the current thread for a given time.
- Returns a time as a string based on one or more formatting codes.
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.