Avatar of chand pb
chand pb
Flag 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
JavaScript

Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott Fell

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23