Dear
sir
I want to say that how to get the age of birthday in to date difference
Example current date - date of birth
Please Explain me
Regards
UmashankarSahu
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 8, 2012, 6:10 AM
To deal with this problem, I usually calculate age using a notional 372 day year which contains 12 months of 31 days each:
The above algorithm assumes that a person born on 29 February in a leap year celebrates their birthday on 1 March in a non-leap year.
kumar varmaPosted Dec 8, 2012, 1:30 AM
UmashankarSahu
I Hope this code will be useful to you.
//Public DateTime Current_Date=DateTime.Now; (write this line after Initializecomponent(); } )
DateTime dob=dateTimePicker1.value;
DateTime PresentYear=Current_Date;
TimeSpan ts=PresentYear - dob;
int age = ts.Days / 365;
// and assign the ts value into textbox u want;
textbox.text=age.ToString();
Regards,
Kumarvarmareddy