Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-21-2005, 04:53 AM   PM User | #1
deepakmittal6_b
New to the CF scene

 
Join Date: Dec 2005
Location: Bangalore,India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
deepakmittal6_b is an unknown quantity at this point
Finding Date difference between two dates

How to compare two dates in Java script.
I need to find the difference between two dates.
Although i have found a method on this site but I am not sure about this whether it is right or not.
Because this logic fails for some values.

sysdate= Date.parse(date2,month2,year2);
entereddate= Date.parse(date1,month1,year1);
defauldate=Date.parse(defaultdate);

alert(sysdate);
alert(entereddate);
alert(defauldate);
alert((sysdate-entereddate)/(24*60*60*1000));
alert((entereddate-defauldate)/(24*60*60*1000));

Please reply back in anyone finds the answer.

Regards,
Deepak
deepakmittal6_b is offline   Reply With Quote
Old 12-21-2005, 07:21 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
You will find the solution at
http://www.codingforums.com/showthread.php?t=121
Philip M is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:42 PM.


Advertisement
Log in to turn off these ads.