Reputation: 103
i have
var hours = sender.get_selectedDate() - LoginTime.get_selectedDate();
var Hou = parseFloat((hours % 86400000) / 3600000).toFixed(2);
I am getting hours = 34200000 and Hou = 9.50
But i need to get 9 Hours and 30 Minits
how to do this...
Upvotes: 0
Views: 140
Reputation: 57650
Converting 9.5
to 9:30
is easy, isn't it? Just use simple math.
h=Math.floor(Hou);
m=(Hou-h)*60;
s=h+":"+m // s= '9:30'
Upvotes: 1
Reputation: 361
use timespan type ..and you can directly add or subtract using its properties.
Upvotes: 0