Plz any one write code for to get age of a person in mvc4
plz any one write code for to get age of a person in mvc4.urgent
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jayakumar BalasubramaniamRank #267 · 9.5K reputationPosted Aug 1, 2014, 6:35 AM EDT
now code..
/////////////
int age=0;
age= ((DateTime.Now - DOB).TotalDays)/(365);
///////////
Explanation:
(DateTime.Now - DOB).TotalDays It will yield total days elapsed from his dateof birth to today and if we divide that count of days by 365, that is the age of the person.