I am trying to do this in views.py
ExtractYear(date_of_birth) - today.year
But it gives error to use int, and i tried like:
int (ExtractYear(date_of_birth) )- int(today.year)
and it gives error of int() argument must be a string, a bytes-like object or a number, not 'ExtractYear'
and also if i try to do this:
date_of_birth_year - today.year
it gives error of name 'date_of_birth_year' is not defined
also i did:
import datetime
I just wanted to find age of person in integer and i don't know how to extract year, hours etc things in datefield or datetime field kindly help.