mam datę ciąg i chcesz przekonwertować go do typu Data:Python -Usuń Czas od Datetime String
próbowałem użyć datetime.datetime.strptime z formatem, który chcę, ale to jest zwrócenie czas z konwersją.
when = alldates[int(daypos[0])]
print when, type(when)
then = datetime.datetime.strptime(when, '%Y-%m-%d')
print then, type(then)
To co powraca wyjściowe:
2013-05-07 <type 'str'>
2013-05-07 00:00:00 <type 'datetime.datetime'>
muszę wyjąć czas: 00:00:00.
Dzięki za prostą odpowiedź! –