Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def date_conversor(date):
- # print(date)
- date = date.split()
- month = date[0]
- day = date[1]
- try:
- year = date[2]
- except IndexError:
- # print("\nGet birthdate[year] has failed, this info sens to be private.\n")
- year = "0000"
- final_date = ""
- month = month.lower()
- months = {'january': 1, 'february': 2, 'march': 3, 'april': 4, 'may': 5, 'june': 6, 'july': 7, 'august': 8, 'september': 9, 'october': 10, 'november': 11, 'december': 12}
- final_date = "{}".format(year + '-' + '%s' % months[month] + '-' + day).replace(',','')
- return final_date
Add Comment
Please, Sign In to add comment