Can you post the code you've used so far?
var result = endMin - startMin;
if (result < 0 ) result = (24*60) + result;
Most are much more intricate and quite lengthy.
Yeah, that's not going to work, since these are not regular number fields... You would basically need to convert them into Date objects and then calculate the difference between those variables. This issue was discussed here many times in the past. Try searching the forum for "time calculation" or something like that.
If you're interested in setting it up without having to write any code I've developed a tool that allows you to do it very easily, and it will also handle dates that are on different dates correctly. You can find it here: Custom-made Adobe Scripts: Acrobat -- Calculate Time Differences in a Worksheet
Acrobat JS has the util.scand method for converting date and time strings into the JS Date object. Then one can use the getTime method of JS to obtain the number of milliseconds since the Epoch date. With this value for the 2 times one can compute the number of milliseconds between the two times and then convert that value to your chosen time unit.
Thom Parker has written several tutorials about this process.