mktime() function in python by R4R Team

- mktime() is a python function predefined in time library.
- mktime() function is the inverse function of localtime()

Syntax-

time.mkdir(tuple)

-Here tuple length must be 9


program-

import time

t=(2019,3,4,1,7,8,9,1,2)
se=time.mktime(t)
print(time.localtime(se))

t=(2019,3,5,1,7,8,9,1,2)
se=time.mktime(t)
print(time.localtime(se))


output-

time.struct_time(tm_year=2019, tm_mon=3, tm_mday=4, tm_hour=1, tm_min=7, tm_sec=8, tm_wday=0, tm_yday=63, tm_isdst=0)
time.struct_time(tm_year=2019, tm_mon=3, tm_mday=5, tm_hour=1, tm_min=7, tm_sec=8, tm_wday=1, tm_yday=64, tm_isdst=0)




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!