Date field component

im trying to get a start date and an end date this is the code Im using but I dont have a clue what else I can do?

on (change){

var sd = new Date(Date.UTC(startDate.selectedDate));
var nd = new Date(Date.UTC(_root.endDate.selectedDate));

trace((nd - sd) / 1000 / 3600 / 24);

}

this is the script Im trying but it doesnt work???
please help me!!!