Important Notice:

Course Content
The Calendar Module
Library Function/Predefined Functions
0/4
Sys Module
Library Function/Predefined Functions
0/2
OS Module
Library Function/Predefined Functions
0/2
Functions in Python (Chapter-10) M3-R5
About Lesson

Time():-

        To get how many ticks have passed since the epoch, you call the python time() method.             

Example:

import time

print(time.time())

output

1687421227.8807673

 

from datetime import time

a=time()

print(a)

b=time(10,20,40)

print(b)

Output

00:00:00

10:20:40

 

from datetime import time

a=time(10,20,30)

print(“hour: “,a.hour)

print(“Minute: “,a.minute)

print(“Second: “,a.second)

Output:-

hour:  10

Minute:  20

Second:  30

 

error: Content is protected !!