I have a bunch of excel documents I am extracting dates from. I am trying to convert these to a standard format so I can put them in a database. Is there a function I can th
You can use a regex like r'(\d+)\D(\d+)\D(\d+)' to get the month, day and year in a tuple with the re.findall function.
then just concatenate the 2-digit years with the number 20 or 19 and use the separator you want to join then back:
'/'.join(the_list)
As pointed by Tim:
To normalize days, just do '{0:0>2}'.format(day) and the same to months.