in javascript I got two dates. How to find the difference between two dates.
var first = document.getElemetById("first_date").value;
var last = document.getElemetById("last_date").value;
the date format is mm/dd/yyyy(07/19/2015);
how to find?
AntonyRayan
15
Posting Whiz in Training
Recommended Answers
Jump to PostIn Javascript this is never a simple task, at least for me, so I prefer to stick with libraries. While waiting for more appropriate suggestions, try with the
difference()
function in moments.js library:
All 4 Replies
cereal
1,524
Nearly a Senior Poster
Featured Poster
diafol
commented:
+rep for moment - brilliant I use it a lot
+15
kgweb
0
Newbie Poster
AntonyRayan
15
Posting Whiz in Training
Purvi_1
-12
Light Poster
Banned
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.