How can I find the age of person by his birthdate? I am taking the birthdate from user through date picker. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How can I find the age of person by his birthdate? I am taking the birthdate from user through date picker.

I want a func that will Calculate age of person by using his birthday and should return his age in int. I want it in swift 4.Any help will be appreciated.

12th Dec 2017, 11:03 AM
Tejal Patel
Tejal Patel - avatar
2 Answers
0
I did it by setting the max value of dateformatter to - 18 years. :)
13th Dec 2017, 2:13 AM
Tejal Patel
Tejal Patel - avatar
0
are you looking for code?
12th Dec 2017, 8:55 PM
Shivam Gupta