var createdon= crmForm.all.createdon.DataValue;
var now = new Date();
//Set the two dates
now =new Date();
//Set 1 day in milliseconds
var one_day=1000*60*60*24;
//Calculate difference btw the two dates, and convert to days
var Age = Math.ceil((now.getTime()-createdon.getTime())/(one_day));
crmForm.all.new_field.DataValue= String(Age);