datetime new date example
Example 1: datetime python
from datetime import datetime as d
date = d.now()
print(date.strftime("%Y-%m-%d %H:%M:%S"))
Example 2: date.month date time
import datetime
dt = datetime.datetime.today()
print dt.year
# Output: 2016
print dt.month
# Output: 8
print dt.day
# Output: 22