I want to calculate the ones year of birth by taking his current age, for eg his age is 30, in datetimepicker box the date should be displayed as 01/01/1982
. It should be auto calculation.
int todayyears = int.Parse (DateTime.Now.Year.ToString());
int a = int.Parse (int.Parse(txt_age.Text).ToString());
string dif = (todayyears - a).ToString();
txt_dob.Text = dif;
Here txt_age
is input value given, txt_dob
is diaplayed the date of birth automatically after the input given in txt_age
.