<?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: How old are you, really?</title>
	<atom:link href="http://blog.christopherschultz.net/index.php/2005/08/07/how-old-are-you-really/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.christopherschultz.net/index.php/2005/08/07/how-old-are-you-really/</link>
	<description>Rantings of a Lunatic</description>
	<lastBuildDate>Sun, 18 Mar 2007 23:44:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ian</title>
		<link>http://blog.christopherschultz.net/index.php/2005/08/07/how-old-are-you-really/comment-page-1/#comment-3022</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Sat, 22 Apr 2006 13:43:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.christopherschultz.net/?p=32#comment-3022</guid>
		<description>I&#039;ve posted the code on my ISP&#039;s website at http://www.sensical.net/bb/viewtopic.php?t=219

Have fun!
Ian.
PS Sensical.net are great!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve posted the code on my ISP&#8217;s website at <a href="http://www.sensical.net/bb/viewtopic.php?t=219" rel="nofollow">http://www.sensical.net/bb/viewtopic.php?t=219</a></p>
<p>Have fun!<br />
Ian.<br />
PS Sensical.net are great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://blog.christopherschultz.net/index.php/2005/08/07/how-old-are-you-really/comment-page-1/#comment-3010</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Fri, 21 Apr 2006 18:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.christopherschultz.net/?p=32#comment-3010</guid>
		<description>Chris, It&#039;s cut off again ... email me and I&#039;ll send it you on email. Ian</description>
		<content:encoded><![CDATA[<p>Chris, It&#8217;s cut off again &#8230; email me and I&#8217;ll send it you on email. Ian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://blog.christopherschultz.net/index.php/2005/08/07/how-old-are-you-really/comment-page-1/#comment-3009</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Fri, 21 Apr 2006 18:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.christopherschultz.net/?p=32#comment-3009</guid>
		<description>Hmm it seems to have cut off the code from my post, continuing ...

        int lDayDiff = lToDay - lFromDay;

        if( lDayDiff </description>
		<content:encoded><![CDATA[<p>Hmm it seems to have cut off the code from my post, continuing &#8230;</p>
<p>        int lDayDiff = lToDay &#8211; lFromDay;</p>
<p>        if( lDayDiff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://blog.christopherschultz.net/index.php/2005/08/07/how-old-are-you-really/comment-page-1/#comment-3008</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Fri, 21 Apr 2006 18:38:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.christopherschultz.net/?p=32#comment-3008</guid>
		<description>Hi Chris,

Firstly, thanks for your DateDiff code.  I&#039;ve been successfully using it for a while in the invoice code for the Sensical.net website control panel.

Now the bad news :-(
I&#039;ve found a problem when diffing between 10-Jan-2005 and 9-Jan-2006 - the algorithm returns -1,11,30 when it should return 0,11,30.  I cannot post a fix, sorry, because I don&#039;t fully understand the code.  However, I have found alternative code which I paste below - I hope this is some help!

Ian.

    public static int[] getDiff( Calendar from, Calendar to )
    {
       System.err.println( &quot;Calc diff from &quot; + from.getTime() + &quot; to &quot; + to.getTime() );

        int lFromYear = from.get( Calendar.YEAR );
        int lFromMonth = from.get( Calendar.MONTH );
        int lFromDay = from.get( Calendar.DAY_OF_MONTH );

        int lToYear = to.get( Calendar.YEAR );
        int lToMonth = to.get( Calendar.MONTH );
        int lToDay = to.get( Calendar.DAY_OF_MONTH );

        int lYearDiff = lToYear - lFromYear;
        int lMonthDiff = lToMonth - lFromMonth;
        int lDayDiff = lToDay - lFromDay;

        if( lDayDiff </description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Firstly, thanks for your DateDiff code.  I&#8217;ve been successfully using it for a while in the invoice code for the Sensical.net website control panel.</p>
<p>Now the bad news :-(<br />
I&#8217;ve found a problem when diffing between 10-Jan-2005 and 9-Jan-2006 &#8211; the algorithm returns -1,11,30 when it should return 0,11,30.  I cannot post a fix, sorry, because I don&#8217;t fully understand the code.  However, I have found alternative code which I paste below &#8211; I hope this is some help!</p>
<p>Ian.</p>
<p>    public static int[] getDiff( Calendar from, Calendar to )<br />
    {<br />
       System.err.println( &#8220;Calc diff from &#8221; + from.getTime() + &#8221; to &#8221; + to.getTime() );</p>
<p>        int lFromYear = from.get( Calendar.YEAR );<br />
        int lFromMonth = from.get( Calendar.MONTH );<br />
        int lFromDay = from.get( Calendar.DAY_OF_MONTH );</p>
<p>        int lToYear = to.get( Calendar.YEAR );<br />
        int lToMonth = to.get( Calendar.MONTH );<br />
        int lToDay = to.get( Calendar.DAY_OF_MONTH );</p>
<p>        int lYearDiff = lToYear &#8211; lFromYear;<br />
        int lMonthDiff = lToMonth &#8211; lFromMonth;<br />
        int lDayDiff = lToDay &#8211; lFromDay;</p>
<p>        if( lDayDiff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mom</title>
		<link>http://blog.christopherschultz.net/index.php/2005/08/07/how-old-are-you-really/comment-page-1/#comment-1757</link>
		<dc:creator>mom</dc:creator>
		<pubDate>Sun, 14 Aug 2005 13:44:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.christopherschultz.net/?p=32#comment-1757</guid>
		<description>Could you write a &quot;calendar&quot; code for getting together to actually celebrate those birthdays, anniversary etc. ???    : ^)</description>
		<content:encoded><![CDATA[<p>Could you write a &#8220;calendar&#8221; code for getting together to actually celebrate those birthdays, anniversary etc. ???    : ^)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

