datetime time
-
[Python] Convert time string type to datetime time type. (시간문자열을 타임 타입으로 변환)Python/Python Programming 2019. 10. 14. 00:21
datetime.time(hour, minute, second) * hour, minute, second는 숫자(interger) from datetime import time timefield = '16:20:01' hour, minute, second = [int(x) for x in timefield.split(':')] t = time(hour, minute, second) print(type(t)) print(t) --------------------------------------------------------------- 16:20:01