Jul-01-2020, 06:20 PM
(Jun-29-2020, 09:22 PM)Yoriz Wrote:from datetime import datetime day, month, year = ('1', 'January', '2000') mydate = datetime.strptime(f'{day} {month} {year}', '%d %B %Y') print(mydate) today = datetime.now() print(today) years = today.year - mydate.year print(years)
Output:2000-01-01 00:00:00 2020-06-29 22:21:04.644274 20
Thanks! That worked, but I'm only getting the date based on 2000-01-01. When I try to change the month it gives me back this error:
"Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
TypeError: update() takes 1 positional argument but 2 were given"
How can I get the all the age and the birthday that may be inserted?
Thanks again