| Author: aswathi 22 Jul 2008 | Member Level: Silver | Rating: Points: 3 |
you can use sonething like this , i hope minus the year of dob from that of today likewise month then week
DateTime.Today.Year - dob.Year; DateTime.Today.Month-dob.Month
|
| Author: PRAVEEN PANDEY 22 Jul 2008 | Member Level: Silver | Rating: Points: 0 |
no this will not work..
|
| Author: veena 22 Jul 2008 | Member Level: Silver | Rating: Points: 3 |
you can use the datediff function,depending upon the interval you choose you will get the result in year or month or days like that.but if you want the age like "5 years,4 months,23 days" den you have to write your own program
|
| Author: veena 22 Jul 2008 | Member Level: Silver | Rating: Points: 3 |
you can use the datediff function,depending upon the interval you choose you will get the result in year or month or days like that.but if you want the age like "5 years,4 months,23 days" den you have to write your own program
|
| Author: Roshan R Mhatre 22 Jul 2008 | Member Level: Gold | Rating: Points: 3 |
you can use sonething like this , i hope minus the year of dob from that of today likewise month then week
DateTime.Today.Year - dob.Year; DateTime.Today.Month-dob.Month
|
| Author: Senthil vel 22 Jul 2008 | Member Level: Gold | Rating: Points: 4 |
just try this...
public int CalculateAge(DateTime birthDate) { DateTime now = DateTime.Today; int years = now.Year - birthDate.Year; if (now.Month < birthDate.Month || (now.Month == birthDate.Month && now.Day < birthDate.Day)) --years;
return years; }
|