Python Question

ImportError: No module named date

I can import datetime and access datetime.date but when I try to import datetime.date directly I get an import error. Why is this?

>>> import datetime
>>> print datetime.date
<type 'datetime.date'>
>>> import datetime.date
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named date
>>>


https://svn.python.org/projects/sandbox/trunk/datetime/datetime.py

There seems to be a date class in datetime.py and today under that

To make matters more confusing there is datetime.date.today and datetime.datetime.now
https://www.codecademy.com/en/forum_questions/523fb72b80ff3325c6000732

Answer Source
>>> from datetime import date
>>> now = date.today
>>> now().month
8

You can use a variable to use the function directly