How to get the number of days between two Javascript dates?

Asked

Viewed 23 times

0

Good evening! The database in which I work returns me two dates in milliseconds. How can I calculate the difference in days between the two dates?

Example:

Data1: 1619226924035ms
Data2: 1619406000000ms

Return: 5 days

  • 1

    And by the calculations in the answer codes, it’s returning 2 days instead of 5.

  • @Cmtecardeal yes yes... it was just an example

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.