This issue was discussed many times on the forums. Calculating time differences using JS is not a simple task.
Here are a couple of good tutorials on the subject:
If you already wrote some code and it's not working well, you can post it here, or upload the file to a file-sharing site and then post the link to it here.
If you're interested, I've also developed a tool that allows you to set up such calculations quite easily, without having to write any code. You can purchase it from here: Custom-made Adobe Scripts: Acrobat -- Calculate Time Differences in a Worksheet
You need to convert your time string to a DateTime object and then use the properties of this object to perform your calculations.
Are you trying to compute elapsed time between 2 events or trying to compute a future or past time?
Time for elapsed times can exceed 24 hours but the time within a day can not exceed 24 hours.
See Thom Parkers 3 part series about date and time calculations in the tutorials posted on this site.