How do I get the year and month from a datetime.datetime object? Here is the code I have problems with:
w = whois.whois('http://stackoverflow.com')
datatime = w.expiration_date
print datatime
the printed object is:
[datetime.datetime(2015, 12, 26, 0, 0), u'2015-12-26T19:18:07-07:00']
How do I get year, month, and day from the part datetime.datetime(2015, 12, 26, 0, 0). I guess I could use regex, but there must be a better way to do this.