var = datetime.module()
creates a datetime object
now.date()
return date in YYYY-MM-DD format
now.year
return year
now.month
return month
now.day
return day
now.minute
return minute
now.second
return second
now.time()
returns current time in HH:MM:SS.ms format
now.strftime(“x y z”)
format time
formatting dates with strftime()
#Formatting date display with "Shift Time" # %a -> Mon # %A -> Monday # %d -> 10 # %b -> Jan # %B -> January # %m -> 01
formatting time with strftime()
#Formatting time with "Shift Time" # %H -> hours # %M -> minutes # %S -> seconds # %p -> AM or PM
formatting year with strftime()
#Formatting year # %y - 17 # %Y - 2017
timedelta(x)
calculate times in the past or future
calendar.month(x)
print a calendar for given year
calendar.weekday(x, y, z)
determine dates in the future
calendar.isleap(x)
is this a leap year or not