convert string to date type
-
[Python] Convert time string type to datetime date type. (날짜문자열을 타임 타입으로 변환)Python/Python Programming 2019. 10. 14. 00:26
datetime.date(year, month, day) * year, month, day는 숫자(interger) from datetime import date datefield = '2019-10-11' year, month, day = [int(x) for x in datefield.split('-') ] d = date(year, month, day) print(type(d)) print(d) ----------------------------------------------------------- 2019-10-11