how to find current age from date of birth in python

Solutions on MaxInterview for how to find current age from date of birth in python by the best coders in the world

showing results for - "how to find current age from date of birth in python"
Josefa
14 Mar 2018
1from datetime import date
2
3def calculate_age(born):
4    today = date.today()
5    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
Nicola
24 Feb 2018
1today_date = datetime.datetime.now()
2dob = datetime.datetime(1982, 5, 20)
3print(today_date - dob)
Leticia
24 Jun 2019
1#Python Calculate Age from date of birth:
2
3from datetime import date
4
5def calculate_age(born):
6    today = date.today()
7    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
queries leading to this page
how to find age from date of birth in pythoncalculate age from birthdate pythonhow to calculate age from birthdate colume in pythoncalculate age with date of birth pythonhow to check age from birthdate in pythonpython datetime module calculate agepython calculate age from yearage calculator using pythoncalculate age from date of birth pythonprogram to calculate age in pythoncal age using pythoncalculate age from date of birth in pythonhow can i calculate the age in pythoncompute age from birthdate pythonhow to find age from birthdate in pythonget age from birthdate python datetimepython calculate exact age from date of birthhow to fetch current age from date of birth in pythonpython datetime calculate agepython calc age receive birthdatecalculate age in days pythonpython get age from birthdatecalculate age in particular year pythonpython program to calculate age in yearhow to calculate the age code pythonpython calculate age with birth datecalculate age from birthdate python at particular datecalculate age with function pythonhow to predict age from birth year in pythonpython date of birth to agehow to find current age from date of birth in pythonage calculator in pythoncalculate age from data pythonformula to calculate age from date of birth pythonpython get age using datecalculating age pythonpython calculate age from date of birth days month yearpython calculate age from birthdatepython find age from birthdatepython get date of birthhow to compute age in python manuallypython calculate age from dateage calculator pythonfind age from date of birth and today pythondate of birth from age pythonpython calculate age using yearget age from date of birth pythonhow to know someone 27s age by birthdate in pythonhow to compute age in pythoncalculate age year 2cmonth 2cday from date of birth pythoncalculate age in years pythonhow to enter date of birth in pythonpython calculate birth year from agepython calculate age from date of birthcount datetime to age pythonage calculation in pythonreturn age from date of birth pythonpython age from date of birth calculate age from birthdate pythonpython calculate age python calculate age in dayscalculating age in python sitecalculate age in pythoncreate age from date in python codecalculate age python fucntionhow to calculate age on pythonget date and age in pythonpython cal agehow to find age using pythonhow to calculate the age in pythonhow to calculate age from birth date in datetime pythonfind age using pythonpython program to calculate age python program to calculate age in years 2c months and dayscalculate age with datetime pythondate of birth age calculator pythonpython get age from datecalculating age in pythonbirth calculator by age pythonpython get birth year from agepython birthdate check agehow to calculate the exact age of someone with the birth date 3f pythonpython birth yearpython calculate age based on yearpython get age based on datehow to convert date into age in python defpython age calculatorpython calcualte age from date of birthpython convert birthday to agepython birthdate to agepython program to compute agepython calculate age with birthayhow to get member age based on date of birth using pythonpython how to show your agehow to get the age of given birth date in pythonhow to calculate age in pythonpython taking in date of birth and calculating exact agepython from age to birth yeardate of birth pythonhow to get age using birthdate and current date in pythonwrite a program to calculate age in pythonhow to find current age from date of birth in python