티스토리 뷰

크롤링 하던중 시간 format을 보고 경악하여 찾아 봄

timeStr = 'Jun 10, 2020 4:09:43 PM'
Thistime = datetime.strptime(timeStr, '%b %d, %Y %I:%M:%S %p')
print(Thistime)

#2020-06-10 16:09:43

https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior

 

8.1. datetime — Basic date and time types — Python 2.7.18 documentation

8.1. datetime — Basic date and time types The datetime module supplies classes for manipulating dates and times in both simple and complex ways. While date and time arithmetic is supported, the focus of the implementation is on efficient attribute extrac

docs.python.org

 

댓글
댓글쓰기 폼

티스토리 방명록