Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to counts date from moment js

Math.trunc(
                moment.duration(moment(post_date, "YYYY-MM-DD").diff(
                  moment(pre_date, "YYYY-MM-DD")
                )
                ).asDays())
 
PREVIOUS NEXT
Tagged: #counts #date #moment #js
ADD COMMENT
Topic
Name
2+6 =