From today some other date?
And what do you want returned? Years only, years and months, years months and days, days, or other time value?
Assuming you are using Acrobat and not LiveCycle Designer:
// get dob string value of the DOB field
var sDob = this.getField("DOB").value;
// convert to date object
var oDob = util.scand("dd-mmm-yyyy", sDob);
// convert to milliseconds since Epoch date
var nDob = oDob.getTime();
// todays date in milliseconds since Epoch date
var nToday = (new Date()).getTime();
// compute difference including end date
var nDiff = nToday - (nDob + (1000 * 60 * 60 * 24)) ;
// compute output in whole years
event.value = Math.floor(nDiff / (1000 * 60 * 60 * 24 * 365.2425))