Hi forum
I hope you can help me with a problem on a function which should work properly but isn’t.
The function is:
function timeDiff(time1, time2) {
if(isNaN(Date.parse(time1)) || isNaN(Date.parse(time2))) return '';
return ( ((Date.parse(time2) -Date.parse(time1))/1000)/60 )
}
The problem is that if I set time1 to say 25/05/11 and time2 to say 26/05/2011 the result should be 1440 (the number of minutes in I day) however the result I am receiving is 44640 (the number of minutes in 31 days)
I have check the date formats on the server and the dbase and they are all set to the UK format of dd/mm/yyyy
My data connection is SQL
Any ideas ?
Thanks
bobby