softbless
asked on
Hours difference between 2 dates
Dear All,
I have this variable.
var myTodayDate = new Date();
var myDueDate='2010-11-31'
I want to know how many hours will be for : myDueDate - myTodayDate.
Please advise. Thanks
I have this variable.
var myTodayDate = new Date();
var myDueDate='2010-11-31'
I want to know how many hours will be for : myDueDate - myTodayDate.
Please advise. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
But I guess you have it in JavaScript ?
Actually date.getTime() should also work in JavaScript as milliseconds since 1970
only you don't have these long numbers,
probably simply
(d1.getTime()-d2.getTime() )/3600000
Then do you want to return back integer number of hours?
only you don't have these long numbers,
probably simply
(d1.getTime()-d2.getTime()
Then do you want to return back integer number of hours?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks