2023-10-08 00:00:00" />

[파이썬] 문자열을 날짜로 바꾸는 방법

방법

from datetime import datetime

str = "2023.10.08"
format = "%Y.%m.%d"

dt = datetime.strptime(str, format)
print(dt)
# => 2023-10-08 00:00:00

links

social