0% found this document useful (0 votes)
9 views

Time Loaded

The document discusses the time module in Python, explaining that time is represented as an object rather than a string or timestamp. It covers functions for manipulating time, the EPOCH convention, ticks and seconds since EPOCH, and formats like DST. Functions discussed include time.gmtime(), time.time(), time.process_time(), and time.perf_counter().

Uploaded by

RaJu Bhai
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Time Loaded

The document discusses the time module in Python, explaining that time is represented as an object rather than a string or timestamp. It covers functions for manipulating time, the EPOCH convention, ticks and seconds since EPOCH, and formats like DST. Functions discussed include time.gmtime(), time.time(), time.process_time(), and time.perf_counter().

Uploaded by

RaJu Bhai
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Time Module in Python

---------------------------
1. According To Python Time is an Object, Hence The Programmer Cannot Consider The
Time in Python as a String OR a Timestamp
2. To Operate Upon The Time We Need To Have The Access To The Time Module Class
3. To Get Proper Accuracy Upon The Time, We Have To Set The Required TimeZone
Before Operating Upon The Time Module
4. For Any Software That is Installed and Configured Upon The Computer it
Associated To The Hardware Clock Running on The Machine, and in Turn Integrated To
The Operating System Time Management System Calls
5. The Format of The Pre-Programmed Cloc is : Date, Time and TimeZone

Points To Check Before Operating With The Python Time Module


------------------------------------------------------------------------
1. The Time Module of Python is Actually Wrapped Upon The "C" Language Runtime
Library, Providing The Functions For "Time Manipulation"
2. The Set of Functions Provided By Python Can Integrate With The System Time
Through The "C Runtime Libraries"
3. The Python Time Module Follows The EPOCH Convention, Which Technically Defines
The Starting Point of The Time, Which is Supported By The Dates and Times From The
EPOCH Year as 2038
4. The UNIX EPOCH Time is "Midnight on 12.00 A.M. January 1st 1970"
5. System To System With Respect To The Operating System and The Corresponding
Software The EPOCH Time Can Change
import time
time.gmtime(0)

Note
------
1. gmtime(0) Method Actually Returns The "struct_time" Object

What is Actually Meant By "tick" in Python?


-------------------------------------------------
1. In Practicality We Have a Term Called as "Seconds Since The EPOCH", This
Represents The Time in Seconds That is Elapsed Since "EPOCH"
2. "tick" in Python Refers To The Time Interval Which is a "Floating-Point" Number
Measured as "Units of Seconds"

What is Meant By DST(Daylight Saving Time) Format?


-------------------------------------------------------------
1. Certain Function in Python Time Module Use DST Format, Which is A Mechanism To
Move The Clock "Forward By 1 Hour" During Summer and "Backward By 1 Hour" in Fall

time.time()
time.process_time() : This Returns The Sum of The System and The User CPU Time of
The Current Process, This Function Ignores The Time Elapsed During The Sleep
time.perf_counter() : This Function Uses a Clock With The Highest Precision To
Measure The Short Duration and Factors in The Process Sleep Time

You might also like