여기서 잘못된 것은 무엇입니까?datetime TypeError : 'datetime.datetime'개체에 '__getitem__'특성이 없습니다.
import datetime
someday = datetime.datetime(2014, 9, 23, 0, 0)
someday = datetime.datetime.strptime(someday[:10], '%Y-%m-%d')
print someday
오류 :
TypeError: 'datetime.datetime' object has no attribute '__getitem__'
여기에서 해결하려는 실제 문제는 무엇입니까? "날짜 시간의 날짜 부분을 가져 오는 것"이라면'.date()'메서드를 사용할 수 있습니다. –
가능한 [TypeError : 'datetime.date'개체의 복제본에 '\ _ \ _ getitem \ _ \ _'속성이 없습니다] (http://stackoverflow.com/questions/20831994/typeerror-datetime-date-object-has- no-attribute-getitem) – GLHF