World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITian's, only for AI Learners.
Download our e-book of Introduction To Python
4 (4,001 Ratings)
218 Learners
Shashank Shanu
5 months ago
#!/usr/bin/python3
import time; # importing time module.
num_ticks = time.time()
print ("Number of ticks since 12:00am, January 1, 1970:", num_ticks)
Number of ticks since 12:00am, January 1, 1970: 1594014539.0613124
import time
print (time.localtime())
time.struct_time(tm_year=2020, tm_mon=7, tm_mday=6, tm_hour=11, tm_min=28, tm_sec=10, tm_wday=0, tm_yday=188, tm_isdst=0)
#!/usr/bin/python3
import time
localtime = time.localtime(time.time())
print ("Local current time :", localtime)
Local current time : time.struct_time(tm_year=2020, tm_mon=7, tm_mday=6, tm_hour=11, tm_min=35, tm_sec=2, tm_wday=0, tm_yday=188, tm_isdst=0)
#!/usr/bin/python3
import time
localtime = time.asctime( time.localtime(time.time()) )
print ("Local current time :", localtime)
Local current time : Mon Jul 6 11:50:46 2020
#!/usr/bin/python3
import calendar
cal = calendar.month(2020, 7)
print ("Here is the calendar:")
print (cal)
Here is the calendar:
July 2020
Mo Tu We Th Fr Sa Su
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31