Convert DD/MM/YY To Date In Python (Examples)
How do you convert a string in the format of DD/MM/YY to a date in Python? To convert a string in the format of DD/MM/YY to a date in Python import the datetime library and use the datetime.datetime.strptime(date_string, format_string) function (yes, that is not a typo the datetime library has a datetime class and it contains the strptime function). To make it easier to access the strptime() function it helps to import the datetime class when the datetime library is imported, like so: from datetime import datetime. ...