0

I am using the angular-moment.js to do this functionality. My question is, I am getting from date from API having data, and to date is my sysdate. How to get the number of days between those Two. I have tried, but getting me a few seconds ago for all. Also I printed the two date in console, and i saw the difference is the date format that is getting from API and sysdate. Any Hint, will help me.

Nitin Agarwal
  • 943
  • 1
  • 13
  • 26
  • 1
    see this http://stackoverflow.com/questions/9129928/javascript-how-to-calculate-number-of-days-between-two-dates-using-javascript – Hadi J May 16 '16 at 04:41
  • Please, before asking question, search in all related questions; thank you. – Maher May 16 '16 at 05:37
  • Thanks @Maher for your valuable suggestion, but after going through all the links, I found none. So i posted here. And please if you know answer or suggest help rather than point out me or my question. – Nitin Agarwal May 16 '16 at 06:04
  • Isn't there a straight answer in the docs at https://github.com/urish/angular-moment#amdifference-filter to this question? – thepio May 16 '16 at 06:45
  • No @thepio. Its only showing us the format in which date can get. Any way Thanks. But once again think my question and suggest me please. – Nitin Agarwal May 16 '16 at 10:27

1 Answers1

0
var dateInterval = 0;
dateInterval = (DateTo - DateFrom) / 86400000;
4b0
  • 21,981
  • 30
  • 95
  • 142