Oct 30, 2004 #1 novice2004 Programmer Joined Feb 2, 2004 Messages 62 Location US I get two dates from text fields "10/30/2004" "11/25/2004" How do I determine difference in days? Thank you.
I get two dates from text fields "10/30/2004" "11/25/2004" How do I determine difference in days? Thank you.
Oct 30, 2004 #2 jemminger Programmer Joined Jun 25, 2001 Messages 3,453 Location US subtracting one Date object from another gives you the difference between the two in milliseconds. this ought to do it: Code: var d1 = new Date("10/30/2004"); var d2 = new Date("11/25/2004"); var days = (d2 - d1) / 1000 / 60 / 60 / 24; ========================================================= -jeff http://www.jeffemminger.comtry { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); } Upvote 0 Downvote
subtracting one Date object from another gives you the difference between the two in milliseconds. this ought to do it: Code: var d1 = new Date("10/30/2004"); var d2 = new Date("11/25/2004"); var days = (d2 - d1) / 1000 / 60 / 60 / 24; ========================================================= -jeff http://www.jeffemminger.comtry { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }