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
|