|
Hello Everybody,
I have an urgent issue to be solved. I need to calculate the difference between two moments of time in java script.One time variable will be got from the form textbox and another will be got from DB and stored in the form as hidden variable.
Let the variable from form be
time1="8:00:00"
and from the db be
time2="16:25:45"
I need to find time1-time2.
Pls help me to get through this...
Thanks for ur timely Help.
|
|
|
you can do it as follows:
var StartTime= new Date(00,00,0000,08,10,00);
var EndTime= new Date(00,00,0000,08,25,00);
var DiffTime = new Date();
DiffTime = EndTime - StartTime;
But the output will be in mili-seconds. To make seconds divide DiffTime by 1000. Again to make minutes, divide DiffTime by 60 etc.
|
|
|
|
|
|
|
// |