Difference between two datehttp://forums.asp.net/t/1772698.aspx?Difference+between+two+dateFri, 24 Feb 2012 14:19:40 -050017726984845903http://forums.asp.net/p/1772698/4845903.aspx?Difference+between+two+dateDifference between two date <p>How can I calculate two date&nbsp;difference like&nbsp; this?</p> <p>d1= 12.05.2010 , d2= 15.07.2012</p> <p>d2-d1=&nbsp; 2 year 2month 3 day</p> 2012-02-22T21:31:05-05:004845947http://forums.asp.net/p/1772698/4845947.aspx?Re+Difference+between+two+dateRe: Difference between two date <p>difference of dates is TimeSpan</p> <p>http://msdn.microsoft.com/en-us/library/system.timespan.aspx</p> <p>format the TimeSpan as you want to.</p> <p></p> 2012-02-22T22:19:10-05:004846110http://forums.asp.net/p/1772698/4846110.aspx?Re+Difference+between+two+dateRe: Difference between two date <p>Basic idea:</p> <pre class="prettyprint">var d1 = &quot;12.05.2010&quot;, d2 = &quot;15.07.2012&quot;, dRegExp = /(\d{1,2})\.(\d{1,2})\.(\d{4})/, ms_one_day = 1000 * 60 * 60 * 24, dp1,dp2,date1,date2,msDiff; dp1 = d1.match(dRegExp); dp2 = d2.match(dRegExp); date1 = new Date( dp1[2] &#43; &quot;/&quot; &#43; dp1[1] &#43; &quot;/&quot; &#43; dp1[3]); date2 = new Date( dp2[2] &#43; &quot;/&quot; &#43; dp2[1] &#43; &quot;/&quot; &#43; dp2[3]); msDiff = date2 - date1; alert( msDiff ); alert( Math.floor(msDiff/ms_one_day) &#43; &quot; days&quot; );</pre> <p>I am sure you can figure out the math for getting years/months</p> 2012-02-23T03:36:14-05:004846153http://forums.asp.net/p/1772698/4846153.aspx?Re+Difference+between+two+dateRe: Difference between two date <p>Hi guys,</p> <p>Thanks, It is exactly what I was searching for. So clear explanation.</p> <p>________________________</p> <p>Oscar Gómez</p> <p>Engineer at PSL</p> <p><a href="http://www.pslcorp.com/">http://www.pslcorp.com/</a></p> 2012-02-23T04:15:18-05:004846337http://forums.asp.net/p/1772698/4846337.aspx?Re+Difference+between+two+dateRe: Difference between two date <p>Hi,<br> <br> check this site:<br> <a href="http://stackoverflow.com/questions/676824/how-to-calculate-the-difference-between-two-dates-using-php">http://stackoverflow.com/questions/676824/how-to-calculate-the-difference-between-two-dates-using-php</a><br> <br> </p> 2012-02-23T06:07:10-05:004849359http://forums.asp.net/p/1772698/4849359.aspx?Re+Difference+between+two+dateRe: Difference between two date <p>Ozo,</p> <p>Try</p> <p>Moment.js A Lightweight Javascript Date Library -&nbsp;<a href="http://magazine.nuefolio.com/2011/11/moment-js-a-lightweight-javascript-date-library/">http://magazine.nuefolio.com/2011/11/moment-js-a-lightweight-javascript-date-library/</a></p> 2012-02-24T14:19:40-05:00