[Vuejs]-How to convert timestamp to days?

0👍

Use moment.js, you can get your desired data the way you want. First do install moment and then import & use.

Below are ways to get days:

Ex-1:( This will provide you No_of_Days days ago ( e.g- 10 days ago)

moment("2020-04-02 16:59:29").fromNow()

Ex-2: (If you want only 10 days without ago then use below)

moment("2020-04-02 16:59:29").fromNow(true)

For more information visit https://momentjs.com/

Leave a comment