from datetime import datetime
timenow = datetime.now() # Current Time
dt = timenow.strftime('%m-%d-%Y, %H:%M:%S') # datetime
print(dt)
04-11-2019, 13:20:17
year1 = timenow.strftime('%Y') # Year with century as a decimal number
print(year1)
2019
year2 = timenow.strftime('%y') # Year without century as a zero-padded decimal number
print(year2)
19
month1 = timenow.strftime('%m') # Month as a zero-padded decimal number
print(month1)
04
month2 = timenow.strftime('%b') # Month as locale’s abbreviated name
print(month2)
Apr
day1 = timenow.strftime('%d') # Day of the month as a zero-padded decimal number
print(day1)
11
hour = timenow.strftime('%H') # Hour (24-hour clock) as a zero-padded decimal number
print(hour)
13
minute = timenow.strftime('%M') # Minute as a zero-padded decimal number
print(minute)
20
seccond = timenow.strftime('%S') # Second as a zero-padded decimal number
print(minute)
17
time = timenow.strftime('%T') # time
print(time)
13:20:17