java - Subtracting two dates with time in JSTL -
this question has answer here:
- display date diff in jsp 3 answers
let's have 2 variables called admitteddate
, currentdate
. contain values
"2014-10-13 14:47:44.0"
i want cast them dates , subtract them , show them in webpage. can help?
javascript
var differenceinmin=(new date(admitteddate ).getmilliseconds()-new date(currentdate).getmilliseconds())/60000; var diffinhrs=differenceinmin/60; var diffindays=parseint(diffinhrs/24)+" "+parseint(diffinhrs)+":"+((diffinhrs-parseint(diffinhrs))*60);
Comments
Post a Comment