Time function in python
# # # Time module in python
# # import time
# # start = time.time()
# # k = 0
# # while(k<45):
# # print("hello this is my")
# # time.sleep(.1243)
# # k+=1
# # print("\nThis is the time after while loop exit(): ", time.time() - start,"\n")
# # end = time.time()
# # for ch in range(45):
# # print("Hello this is my")
# # print("\nThis is the time after while loop exit(): ", time.time() - end)
# # # import time
# # # # localtime = time.asctime(time.localtime(time.time()))
# # # # print(dir(time))
# # # # k = 0
# # # # while k < 10:
# # # # print(f"hello world")
# # # # k+=1
# import time
# print(time.asctime(time.localtime(time.time())))
# # print(dir(time))
import time
# print(time.ctime())
# print(time.time())
# print(time.ctime(time.time()))
# time_object = time.localtime()
# print(time_object)
# print(time.strftime("%H:%M:%S", time_object))
# for universel time butt must have to pass with strftime function
# time_universerl = time.gmtime()
# print(time_universerl)
time_string = "20 April, 2020"
print(time.strptime(time_string,"%d %B %Y"))
Comments
Post a Comment