Link to home
Start Free TrialLog in
Avatar of chand pb
chand pbFlag for United States of America

asked on

get the difference between two date in days in javascript or moment.js

Hello,
  How do I get the difference between 2 date in days

e,g diff (2015-03-15T00:00:00",today) = 2

I tried moment.js .. but it return "2 days ago" .. I would like a number

var x =moment("2015-03-15T00:00:00", "YYYY-MM-DDThh:mm:ss").fromNow();

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial