Django ビューで日時を ISO 8601 に変換して、Facebook ページのイベントにプッシュしています。私は試しましdatetime.strptime
たが、私が選んだ最善のアドバイスに従ってください:
eventdate = event.date
print eventdate
date_iso = dateutil.parser.parse(eventdate)
eventdate は、印刷するとコンソールで次のように表示されます2013-06-18 02:50:00
が、取得する前にそれ以上取得しません:
Django Version: 1.4.1
Exception Type: AttributeError
Exception Value:
'datetime.datetime' object has no attribute 'read'
Exception Location: /Users/mirth/.virtualenvs/ssc/lib/python2.7/site-packages/dateutil/parser.py in get_token, line 72
Python Executable: /Users/mirth/.virtualenvs/ssc/bin/python
Python Version: 2.7.2
Python Path:
['/Users/mirth/code/django/ssc',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/site-packages/requests/packages',
'/Users/mirth/code/django/ssc/main',
'/Users/mirth/code/django/ssc/main/../',
'/Users/mirth/code/django/ssc',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg',
'/Users/mirth/.virtualenvs/ssc/lib/python27.zip',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/plat-darwin',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/plat-mac',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/lib-tk',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/lib-old',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/site-packages',
'/Users/mirth/.virtualenvs/ssc/lib/python2.7/site-packages/PIL']
これは何ですか?ありがとう