hi, i am going to try and make a new app that will add up in time, for example if i put i could add 240 hours 23 minutes and 14 hours 59 minutes together. unfortuantly i havnt got a clue where to start because as soon as the minutes goes over 60 it will need to plus 1 hour and start again at 0, can anyone please help me get started in this, thanks Rob

thats great thanks, but what if the mins is more thatn 60, ie 74 i know that the hour will go up to 1 but what will happen to the remaining 14 seconds?

Well, try this: if (minutes => 60) { minutes -= 60 hour += 1 } like this when minutes are more than 60 we add an our and we add the minutes -60 Ex: 74 min= 1 hour + (74-60) min = 1 hour + 14 min

var date = new Date(); hrs = date.getHour mins = date.getMinutes secs = date.getSeconds log (hrs+" : "+mins+" : "+secs) Thats how you get the time ------------------double post merged------------------ var date = new Date(); hrs = date.getHour mins = date.getMinutes secs = date.getSeconds log (hrs+" : "+mins+" : "+secs) Thats how you get the time

Convert the times to milliseconds add the millisecond values together and then convert the result back. See if this helps.... Code: function timeToMS(day,hour,min,sec,ms){ return ms+(sec*1000)+(min*60000)+(hour*3600000)+(day*86400000) } function msToTime(ms){ milliseconds = ms% 1000; seconds = Math.floor(ms/1000) % 60; minutes = Math.floor(ms/60000) % 60; hours = Math.floor(ms/3600000) % 24; days = Math.floor(ms/86400000); log(days+" "+hours+" "+minutes+" "+seconds+" "+milliseconds); } time1=timeToMS(0,18,59,50,0); time2=timeToMS(1,0,0,15,0); msToTime(time1+time2);

ok, thanks for all you help so far,problem that i have now is that i cant work out how to input the times? the only way that i have worked it out so far is to put the hours in one text field and then the minutes into another. i have tried various different methods of getting the times to add up but everything just gives the same two times in the output box, not a total of the two times. also how to i get the formula that PAEz above has posted to read these values and add them together for me? thanks i have tried to post a sample of the code that i am using but these pcs that i am using wont allow anything to upload Please Register or Log in to view images

Keep going with it, also, there's an app like this in the app store, so if someone could look around in it, you could get an idea of what you have to do. I think it's called time calculator or something...

well i finally got it sorted, thanks a lot PAEz, it was your code that i managed to work. cheers for the help