<?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: Calculating the number of days between two selected dates in a DateChooser control</title>
	<atom:link href="http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: chinmay</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-10103</link>
		<dc:creator>chinmay</dc:creator>
		<pubDate>Sat, 29 Oct 2011 05:08:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-10103</guid>
		<description>hey could you tell me how to find the number of days between two dates using both datefield and datechooser also BindingUtils.bindProperty should be used.</description>
		<content:encoded><![CDATA[<p>hey could you tell me how to find the number of days between two dates using both datefield and datechooser also BindingUtils.bindProperty should be used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc Hughes</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-9517</link>
		<dc:creator>Marc Hughes</dc:creator>
		<pubDate>Sun, 21 Aug 2011 13:31:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-9517</guid>
		<description>Not every day is 1000 * 60 * 60 * 24 milliseconds long.

In EST we have 2 days a year that are 23 and 25 hours long to account for daylight savings time.</description>
		<content:encoded><![CDATA[<p>Not every day is 1000 * 60 * 60 * 24 milliseconds long.</p>
<p>In EST we have 2 days a year that are 23 and 25 hours long to account for daylight savings time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hector</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-9066</link>
		<dc:creator>hector</dc:creator>
		<pubDate>Thu, 17 Mar 2011 19:58:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-9066</guid>
		<description>how can i implement the code suggested and return it to a for to use that value</description>
		<content:encoded><![CDATA[<p>how can i implement the code suggested and return it to a for to use that value</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-8853</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Wed, 19 Jan 2011 06:21:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-8853</guid>
		<description>Look in to the various Date getUTC*() type functions:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html#getUTCDate()

Also, there is a static Date.UTC() method which may help.

Peter</description>
		<content:encoded><![CDATA[<p>Look in to the various Date getUTC*() type functions:<br />
<a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html#getUTCDate" rel="nofollow">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html#getUTCDate</a>()</p>
<p>Also, there is a static Date.UTC() method which may help.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tahir Azeem Alvi</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-8851</link>
		<dc:creator>Tahir Azeem Alvi</dc:creator>
		<pubDate>Wed, 19 Jan 2011 05:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-8851</guid>
		<description>Thanks Peter.

And if i want to get always UTC time on my PC or another PC in which my app is run, What i do that for this ?</description>
		<content:encoded><![CDATA[<p>Thanks Peter.</p>
<p>And if i want to get always UTC time on my PC or another PC in which my app is run, What i do that for this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-8833</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Wed, 12 Jan 2011 07:57:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-8833</guid>
		<description>You should just be able to add 7 days to the second date.

Peter</description>
		<content:encoded><![CDATA[<p>You should just be able to add 7 days to the second date.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tahir Azeem Alvi</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-8832</link>
		<dc:creator>Tahir Azeem Alvi</dc:creator>
		<pubDate>Wed, 12 Jan 2011 07:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-8832</guid>
		<description>Hi,

i have a problem face from last day.

The problem is that i want to run a countdown Timer. The timer is start from two dates
1. current date (as New Date()).
2. the immediate Monday (as new Date(“Mon Jan 17 2011″))

The problem is with 2nd date.

How i dynamically find the next Monday date ?.

Thanks and welcome for Help.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>i have a problem face from last day.</p>
<p>The problem is that i want to run a countdown Timer. The timer is start from two dates<br />
1. current date (as New Date()).<br />
2. the immediate Monday (as new Date(“Mon Jan 17 2011″))</p>
<p>The problem is with 2nd date.</p>
<p>How i dynamically find the next Monday date ?.</p>
<p>Thanks and welcome for Help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jayanthi</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-7801</link>
		<dc:creator>jayanthi</dc:creator>
		<pubDate>Wed, 26 May 2010 12:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-7801</guid>
		<description>&lt;pre lang=&quot;actionscript3&quot;&gt;
public static const millisecondsPerDay:int = 1000 * 60 * 60 * 24;
&lt;/pre&gt;
I guess this will do 
&lt;pre lang=&quot;actionscript3&quot;&gt;
private function getDaysDifference(minDate:Date, maxDate:Date):uint
{
// for testing 
// var newDate:Date = new Date(2007,9,23); 
// var oldDate:Date = new Date (2007, 8, 23);
return Math.ceil(( minDate.getTime() - maxDate.getTime()) / millisecondsPerDay);
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> static const millisecondsPerDay<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">1000</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">60</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">60</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">24</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>I guess this will do</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> getDaysDifference<span style="color: #000000;">&#40;</span>minDate<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Date</span><span style="color: #000066; font-weight: bold;">,</span> maxDate<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Date</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #009900; font-style: italic;">// for testing </span>
<span style="color: #009900; font-style: italic;">// var newDate:Date = new Date(2007,9,23); </span>
<span style="color: #009900; font-style: italic;">// var oldDate:Date = new Date (2007, 8, 23);</span>
<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ceil</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span> minDate<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getTime</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">-</span> maxDate<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getTime</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> millisecondsPerDay<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Mitchell</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-7417</link>
		<dc:creator>Jeremy Mitchell</dc:creator>
		<pubDate>Thu, 01 Apr 2010 23:06:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-7417</guid>
		<description>Peter, 

why the need for Math.round?

return Math.round((tempDate.time / MS_PER_DAY) + 1).toString();

you&#039;d think that item.rangeEnd &amp; item.rangeStart wouldn&#039;t have any time associated with it. but i have seen weird things where the difference in milliseconds between 2 dates is often not perfectly divisible by 1000 * 60 * 60 * 24. Which seems very odd...</description>
		<content:encoded><![CDATA[<p>Peter, </p>
<p>why the need for Math.round?</p>
<p>return Math.round((tempDate.time / MS_PER_DAY) + 1).toString();</p>
<p>you&#8217;d think that item.rangeEnd &amp; item.rangeStart wouldn&#8217;t have any time associated with it. but i have seen weird things where the difference in milliseconds between 2 dates is often not perfectly divisible by 1000 * 60 * 60 * 24. Which seems very odd&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geon</title>
		<link>http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/comment-page-1/#comment-7315</link>
		<dc:creator>geon</dc:creator>
		<pubDate>Mon, 22 Mar 2010 09:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/31/calculating-the-number-of-days-between-two-selected-dates-in-a-datechooser-control/#comment-7315</guid>
		<description>pls press date with shift key...</description>
		<content:encoded><![CDATA[<p>pls press date with shift key&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

