<?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; date</title>
	<atom:link href="http://flex.exposedout.net/tag/date/feed/" rel="self" type="application/rss+xml" />
	<link>http://flex.exposedout.net</link>
	<description>i am an itemrendrer in the making!</description>
	<lastBuildDate>Fri, 13 May 2011 10:05:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.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.]]></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>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> compare <span style="color: #66cc66;">&#40;</span>date1 : <span style="color: #0066CC;">Date</span>, date2 : <span style="color: #0066CC;">Date</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">var</span> date1Timestamp : <span style="color: #0066CC;">Number</span> = date1.<span style="color: #0066CC;">getTime</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> date2Timestamp : <span style="color: #0066CC;">Number</span> = date2.<span style="color: #0066CC;">getTime</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> result : <span style="color: #0066CC;">Number</span> = -<span style="color: #cc66cc;">1</span>;<br />
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>date1Timestamp == date2Timestamp<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
result = <span style="color: #cc66cc;">0</span>;<br />
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>date1Timestamp <span style="color: #66cc66;">&gt;</span> date2Timestamp<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
result = <span style="color: #cc66cc;">1</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #b1b100;">return</span> result;<br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>


<p>No related posts.</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>

