<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FlexOut &#187; actionscript</title>
	<atom:link href="http://flex.exposedout.net/tag/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://flex.exposedout.net</link>
	<description>i am an itemrendrer in the making!</description>
	<lastBuildDate>Fri, 11 Jun 2010 15:54:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to compare 2 dates in ActionScript</title>
		<link>http://flex.exposedout.net/2009/05/25/how-to-compare-2-dates-in-actionscript/</link>
		<comments>http://flex.exposedout.net/2009/05/25/how-to-compare-2-dates-in-actionscript/#comments</comments>
		<pubDate>Mon, 25 May 2009 08:23:55 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date.getTime()]]></category>

		<guid isPermaLink="false">http://guavus.wordpress.com/?p=224</guid>
		<description><![CDATA[Date objects don’t have a built-in compare() method, but comparing dates  easy.Don&#8217;t  look at the Date objects , but rather the values represented by the objects using the Date.getTime() method: Date.getTime() : Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object. Use this method to represent a specific [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Date objects don’t have a built-in compare() method, but comparing dates  easy.Don&#8217;t  look at the Date objects , but rather the values represented by the objects using the Date.getTime() method:</p>
<p><em><strong>Date.getTime() : </strong>Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object. Use this method to represent a specific instant in time when comparing two or more Date objects.</em></p>
<p>This makes comparing dates as trivial as comparing numbers. Here’s a simple method that compares two dates, returning minus one (-1) if the first date is before the second, zero (0) if the dates are equal, or one (1) if the first date is after the second:</p>
<blockquote><p>public function compare (date1 : Date, date2 : Date) : Number {<br />
var date1Timestamp : Number = date1.getTime ();<br />
var date2Timestamp : Number = date2.getTime ();<br />
var result : Number = -1;<br />
if (date1Timestamp == date2Timestamp){<br />
result = 0;<br />
} else if (date1Timestamp &gt; date2Timestamp){<br />
result = 1;<br />
}<br />
return result;<br />
}</p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;title=How%20to%20compare%202%20dates%20in%20ActionScript" title="DZone"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;title=How%20to%20compare%202%20dates%20in%20ActionScript&amp;bodytext=Date%20objects%20don%E2%80%99t%20have%20a%20built-in%20compare%28%29%20method%2C%20but%20comparing%20dates%C2%A0%20easy.Don%27t%C2%A0%20look%20at%20the%20Date%20objects%20%2C%20but%20rather%20the%20values%20represented%20by%20the%20objects%20using%20the%20Date.getTime%28%29%20method%3A%0A%0ADate.getTime%28%29%20%3A%20Returns%20the%20number%20of%20millisecond" title="Digg"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=How%20to%20compare%202%20dates%20in%20ActionScript%20-%20http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F" title="Twitter"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;title=How%20to%20compare%202%20dates%20in%20ActionScript&amp;annotation=Date%20objects%20don%E2%80%99t%20have%20a%20built-in%20compare%28%29%20method%2C%20but%20comparing%20dates%C2%A0%20easy.Don%27t%C2%A0%20look%20at%20the%20Date%20objects%20%2C%20but%20rather%20the%20values%20represented%20by%20the%20objects%20using%20the%20Date.getTime%28%29%20method%3A%0A%0ADate.getTime%28%29%20%3A%20Returns%20the%20number%20of%20millisecond" title="Google Bookmarks"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F" title="Technorati"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;title=How%20to%20compare%202%20dates%20in%20ActionScript" title="StumbleUpon"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;t=How%20to%20compare%202%20dates%20in%20ActionScript" title="MySpace"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F" title="Sphinn"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;title=How%20to%20compare%202%20dates%20in%20ActionScript&amp;notes=Date%20objects%20don%E2%80%99t%20have%20a%20built-in%20compare%28%29%20method%2C%20but%20comparing%20dates%C2%A0%20easy.Don%27t%C2%A0%20look%20at%20the%20Date%20objects%20%2C%20but%20rather%20the%20values%20represented%20by%20the%20objects%20using%20the%20Date.getTime%28%29%20method%3A%0A%0ADate.getTime%28%29%20%3A%20Returns%20the%20number%20of%20millisecond" title="del.icio.us"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;t=How%20to%20compare%202%20dates%20in%20ActionScript" title="Facebook"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;title=How%20to%20compare%202%20dates%20in%20ActionScript" title="Reddit"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fflex.exposedout.net%2F2009%2F05%2F25%2Fhow-to-compare-2-dates-in-actionscript%2F&amp;title=How%20to%20compare%202%20dates%20in%20ActionScript" title="Mixx"><img src="http://flex.exposedout.net/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2009/05/25/how-to-compare-2-dates-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
