python - ImportError: No module named date -


i can import datetime , access datetime.date when try import datetime.date directly import error. why 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 date class in datetime.py , today under that

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

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

you can use variable use function directly


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -