<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: FAQ: calculate number of days between two dates in javascript</title>
	<atom:link href="http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/</link>
	<description>php &#124; javascript &#124; ajax &#124; and all things web</description>
	<lastBuildDate>Sat, 04 Feb 2012 08:50:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Tweets that mention calculate number of days between 2 dates in #javascript - -- Topsy.com</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-12668</link>
		<dc:creator>Tweets that mention calculate number of days between 2 dates in #javascript - -- Topsy.com</dc:creator>
		<pubDate>Mon, 27 Dec 2010 13:38:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-12668</guid>
		<description>[...] This post was mentioned on Twitter by Daniel Garnier Paris, Vijay Joshi. Vijay Joshi said: calculate number of days between 2 dates in #javascript - http://goo.gl/Qm0sz [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Daniel Garnier Paris, Vijay Joshi. Vijay Joshi said: calculate number of days between 2 dates in #javascript &#8211; <a href="http://goo.gl/Qm0sz" rel="nofollow">http://goo.gl/Qm0sz</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dipanjan Das</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-10731</link>
		<dc:creator>Dipanjan Das</dc:creator>
		<pubDate>Thu, 01 Jul 2010 04:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-10731</guid>
		<description>what is the difference between the dates : 11JUN10 and 11JUN12 ?</description>
		<content:encoded><![CDATA[<p>what is the difference between the dates : 11JUN10 and 11JUN12 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brusky</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-3655</link>
		<dc:creator>brusky</dc:creator>
		<pubDate>Fri, 03 Jul 2009 08:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-3655</guid>
		<description>hi friends,
I need a function in javascript which must put live date into selectbox but user must select only 9 month higher not more so I will use it for pregnancy advise ,date must be max higher then user enter always will show 9 month
thnks I need your helps...</description>
		<content:encoded><![CDATA[<p>hi friends,<br />
I need a function in javascript which must put live date into selectbox but user must select only 9 month higher not more so I will use it for pregnancy advise ,date must be max higher then user enter always will show 9 month<br />
thnks I need your helps&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NDK</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-3097</link>
		<dc:creator>NDK</dc:creator>
		<pubDate>Fri, 19 Jun 2009 08:57:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-3097</guid>
		<description>If i try to do this it don&#039;t work...

For example:
Current date is 2009,6,19
Test date is 2009,6,21

var date1=new Date(currentDate[2],(currentDate[1]-1),currentDate[0]);
var date2=new Date(datetest[2],(datetest[1]-1),datetest[0])
//I do -1 because: January is 0 and December 11

Current date: 2009,6,19
date: 2009,7,22
date2 = -1325638800000
date1 = -1420333200000
Dif: 1096
(= Math.abs((date1.getTime()-date2.getTime())/(one_day))</description>
		<content:encoded><![CDATA[<p>If i try to do this it don&#8217;t work&#8230;</p>
<p>For example:<br />
Current date is 2009,6,19<br />
Test date is 2009,6,21</p>
<p>var date1=new Date(currentDate[2],(currentDate[1]-1),currentDate[0]);<br />
var date2=new Date(datetest[2],(datetest[1]-1),datetest[0])<br />
//I do -1 because: January is 0 and December 11</p>
<p>Current date: 2009,6,19<br />
date: 2009,7,22<br />
date2 = -1325638800000<br />
date1 = -1420333200000<br />
Dif: 1096<br />
(= Math.abs((date1.getTime()-date2.getTime())/(one_day))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijay</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-2753</link>
		<dc:creator>Vijay</dc:creator>
		<pubDate>Fri, 05 Jun 2009 04:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-2753</guid>
		<description>Cheers!!!</description>
		<content:encoded><![CDATA[<p>Cheers!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jose</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-2748</link>
		<dc:creator>jose</dc:creator>
		<pubDate>Thu, 04 Jun 2009 09:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-2748</guid>
		<description>I found out that the method: date=new Date(date.split(’/&#039;).reverse().join(’,&#039;)) only works in firefox not ie, because firefox accepts also strings in the date object, but ie doesn&#039;t.So your method is the best method so far.
var dates=firstDate.split(&#039;/&#039;);
var day = dates[0];
var month = dates[1]-1;
var year = dates[2];
firstDate = new Date(year, month, day);
This way the date object has inside paramaters not string</description>
		<content:encoded><![CDATA[<p>I found out that the method: date=new Date(date.split(’/&#8217;).reverse().join(’,&#8217;)) only works in firefox not ie, because firefox accepts also strings in the date object, but ie doesn&#8217;t.So your method is the best method so far.<br />
var dates=firstDate.split(&#8216;/&#8217;);<br />
var day = dates[0];<br />
var month = dates[1]-1;<br />
var year = dates[2];<br />
firstDate = new Date(year, month, day);<br />
This way the date object has inside paramaters not string</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jose</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-2544</link>
		<dc:creator>jose</dc:creator>
		<pubDate>Thu, 28 May 2009 13:14:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-2544</guid>
		<description>Ok ,so I split the date into 3 array elements, then i put it in a variable like this var date=new Date(arr[2], arr[1], arr[0]) and thats it.Great, thanx.I did the same thing like this: date=new Date(date.split(&#039;/&#039;).reverse().join(&#039;,&#039;));</description>
		<content:encoded><![CDATA[<p>Ok ,so I split the date into 3 array elements, then i put it in a variable like this var date=new Date(arr[2], arr[1], arr[0]) and thats it.Great, thanx.I did the same thing like this: date=new Date(date.split(&#8216;/&#8217;).reverse().join(&#8216;,&#8217;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jose</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-2537</link>
		<dc:creator>jose</dc:creator>
		<pubDate>Thu, 28 May 2009 10:14:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-2537</guid>
		<description>thank you, but what if I am not from USA and the date is in this format (dd,mm,yyyy)?</description>
		<content:encoded><![CDATA[<p>thank you, but what if I am not from USA and the date is in this format (dd,mm,yyyy)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Satish Puli</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-1087</link>
		<dc:creator>Satish Puli</dc:creator>
		<pubDate>Tue, 10 Mar 2009 05:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-1087</guid>
		<description>Thanks it was very usefull
Thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks it was very usefull<br />
Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijay</title>
		<link>http://www.vijayjoshi.org/2008/10/24/faq-calculate-number-of-days-between-two-dates-in-javascript/comment-page-1/#comment-522</link>
		<dc:creator>Vijay</dc:creator>
		<pubDate>Fri, 13 Feb 2009 05:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.vijayjoshi.org/?p=113#comment-522</guid>
		<description>@SathiyaCG hey thanks!!!</description>
		<content:encoded><![CDATA[<p>@SathiyaCG hey thanks!!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

