Hi Jason,
Here's one way, which works for me. It might not be the most straight forward way, but it makes sense. In this case, the date is in a field called DateOfBirth in the format MM/DD/YYYY. Hope it helps.
Jared Langdon
J. Langdon Consulting
www.jlangdon.cavar strDOBYear = DateOfBirth.rawValue.substr(6,4);
var strDOBMonth = DateOfBirth.rawValue.substr(0,2);
var strDOBDay = DateOfBirth.rawValue.substr(3,2);
var oDOB = new Date(parseInt(strDOBYear,10), parseInt(strDOBMonth,10)-1, parseInt(strDOBDay,10) );
var oToday = new Date();
//determine whether the person's birthday has already occurred this year
var boolBirthdayHasOccurred = false;
if (oDOB.getMonth() < oToday.getMonth())
boolBirthdayHasOccurred = true;
if ((oDOB.getMonth() == oToday.getMonth()) && (oDOB.getDate() <= oToday.getDate()))
boolBirthdayHasOccurred = true;
var nCurrentAge = 0;
if (boolBirthdayHasOccurred)
nCurrentAge = oToday.getFullYear() - oDOB.getFullYear();
else
nCurrentAge = oToday.getFullYear() - oDOB.getFullYear() - 1;