Check out example codes for "how many days ago was 31 december 1999". It will help you in understanding the concepts better.

Code Example 1

// 7,354 days.

Learn ReactJs, React Native from akashmittal.com