Suppose we want to Display only current Month, Year or Day. Python allows us to do this through some predefined Functions.
Functions for Time:
print(current.hour); #Current Hour
print(current.minute); #Current Minute
print(current.second); #Current Second
Following Program Illustrates it:
from datetime import datetime
current=datetime.now(); #assigning variable
print(current.year); #Current year
print(current.month); #Current month
print(current.day); #Current date
Functions for Time:
print(current.hour); #Current Hour
print(current.minute); #Current Minute
print(current.second); #Current Second