<?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: Counting the Days Between Two Java Dates using a Gregorian Calendar</title>
	<atom:link href="http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 10:28:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Keyon</title>
		<link>http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/comment-page-1/#comment-499</link>
		<dc:creator>Keyon</dc:creator>
		<pubDate>Tue, 19 Jul 2011 18:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartkey.co.uk/?p=588#comment-499</guid>
		<description>At last, someone comes up with the &quot;right&quot; awnser!</description>
		<content:encoded><![CDATA[<p>At last, someone comes up with the &#8220;right&#8221; awnser!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tasmine</title>
		<link>http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/comment-page-1/#comment-497</link>
		<dc:creator>Tasmine</dc:creator>
		<pubDate>Mon, 18 Jul 2011 17:47:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartkey.co.uk/?p=588#comment-497</guid>
		<description>Real brain power on dslpiay. Thanks for that answer!</description>
		<content:encoded><![CDATA[<p>Real brain power on dslpiay. Thanks for that answer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Neal</title>
		<link>http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/comment-page-1/#comment-432</link>
		<dc:creator>Steve Neal</dc:creator>
		<pubDate>Wed, 08 Jun 2011 15:41:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartkey.co.uk/?p=588#comment-432</guid>
		<description>Hi Michael,

Thanks for the comment. You are right, the example doesn&#039;t take into account timezones or daylight saving time (DST). To cater for DST, you could add something like this:

&lt;code&gt;long startTime = startCal.getTimeInMillis() + startCal.get(Calendar.DST_OFFSET);
&lt;/code&gt;
to the startTime and endTime calculations.

I originally implemented this as a &#039;soft time&#039; requirement to show how long messages had been in an inbox, so the calculations didn&#039;t need to be precise. I think the above suggestion should make this better now.

Steve.</description>
		<content:encoded><![CDATA[<p>Hi Michael,</p>
<p>Thanks for the comment. You are right, the example doesn&#8217;t take into account timezones or daylight saving time (DST). To cater for DST, you could add something like this:</p>
<p><code>long startTime = startCal.getTimeInMillis() + startCal.get(Calendar.DST_OFFSET);<br />
</code><br />
to the startTime and endTime calculations.</p>
<p>I originally implemented this as a &#8217;soft time&#8217; requirement to show how long messages had been in an inbox, so the calculations didn&#8217;t need to be precise. I think the above suggestion should make this better now.</p>
<p>Steve.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael K</title>
		<link>http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/comment-page-1/#comment-425</link>
		<dc:creator>Michael K</dc:creator>
		<pubDate>Wed, 08 Jun 2011 09:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartkey.co.uk/?p=588#comment-425</guid>
		<description>No, the solution is incorrect since not all days have 24 hours. Think about daylight saving time.</description>
		<content:encoded><![CDATA[<p>No, the solution is incorrect since not all days have 24 hours. Think about daylight saving time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Neal</title>
		<link>http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/comment-page-1/#comment-48</link>
		<dc:creator>Steve Neal</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:46:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartkey.co.uk/?p=588#comment-48</guid>
		<description>Well spotted Bill :)

Looks like the calculations were right, just a terrible choice of variable names.

I&#039;ve changed MILLISECONDS_IN_YEAR to MILLISECONDS_IN_DAY. It&#039;s trying to count days after all, not years.</description>
		<content:encoded><![CDATA[<p>Well spotted Bill <img src='http://blog.smartkey.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Looks like the calculations were right, just a terrible choice of variable names.</p>
<p>I&#8217;ve changed MILLISECONDS_IN_YEAR to MILLISECONDS_IN_DAY. It&#8217;s trying to count days after all, not years.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://blog.smartkey.co.uk/2009/12/counting-the-days-between-two-java-dates-using-a-gregorian-calendar/comment-page-1/#comment-47</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartkey.co.uk/?p=588#comment-47</guid>
		<description>Errr, the number of milliseconds in the year isn&#039;t as you have described it here. You are calculating the number of millis in a day.</description>
		<content:encoded><![CDATA[<p>Errr, the number of milliseconds in the year isn&#8217;t as you have described it here. You are calculating the number of millis in a day.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

