how to calculate the days between two dates excluding saturday and sunday
foe example if i am calculating the days between 14/12/2007 to 17/12/2007
the answer for no of days should be 4...
pls send the code for above problem.
advance thanks
hidash.
hidash_in
-9
Junior Poster in Training
Recommended Answers
Jump to Postvar date1 = new Date(); var date2 = new Date(); var diff = new Date(); diff.setTime(Math.abs(date1.getTime() - date2.getTime())); return (diff.getTime() / (1000 * 60 * 60 * 24));
theres the basics given that date1, date2 are the dates you wish to compare
Jump to Postwell those were the basics which you should be able to adapt upon. for my efforts ive posted it up for all to see.
All 5 Replies
hidash_in
-9
Junior Poster in Training
Fungus1487
55
Posting Pro in Training
hidash_in
-9
Junior Poster in Training
Fungus1487
55
Posting Pro in Training
MidiMagic
579
Nearly a Senior Poster
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.