Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python calculate age from date of birth

from datetime import date

def calculate_age(born):
    today = date.today()
    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #calculate #age #date #birth
ADD COMMENT
Topic
Name
9+3 =