PDA

Click to See Complete Forum and Search --> : [2.0] computing age by date


arshesander
Jun 12th, 2007, 08:27 PM
how to compute age base on age; i do this code but it doesnt work;

int age;
DateTime bday;
DateTime cdate;
bday = DateTimePicker1.Value;
cdate = DateTimePicker2.Today;

age = cdate - bday;

Hack
Jun 13th, 2007, 06:02 AM
Have a look here. (http://snippets.dzone.com/posts/show/1632)

ComputerJy
Jun 15th, 2007, 04:32 AM
remember that DateTime - DateTime = TimeSpan