문제

In Python, Is there a way to definitively check if a string contains a date.? It would be preferable if it could catch any date format, but, if not, could it catch the %B-%w-%Y format.

도움이 되었습니까?

해결책

You can use dateutil.parser module which will parse any human readable date format for you from a string.

http://labix.org/python-dateutil#head-a23e8ae0a661d77b89dfb3476f85b26f0b30349c

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top