Time Module
Anonymous contributor
Anonymous contributor95 total contributions
Anonymous contributor
Published Apr 19, 2022
Contribute to Docs
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
struct_time
.
The following functions are provided by this module.
Time Module
- .ctime()
- Takes a time, expressed in seconds elapsed since the epoch, and returns a formatted string.
- .sleep()
- Suspends execution of the current thread for a given time.
- .strftime()
- Returns a time as a string based on one or more formatting codes.
All contributors
- Anonymous contributorAnonymous contributor95 total contributions
- Anonymous contributor
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.