<?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: Relative dates in Javascript</title>
	<atom:link href="http://www.eahanson.com/2008/12/04/relative-dates-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eahanson.com/2008/12/04/relative-dates-in-javascript/</link>
	<description>My weblog</description>
	<lastBuildDate>Sat, 17 Dec 2011 15:07:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Ayke van Laethem</title>
		<link>http://www.eahanson.com/2008/12/04/relative-dates-in-javascript/comment-page-1/#comment-36862</link>
		<dc:creator>Ayke van Laethem</dc:creator>
		<pubDate>Wed, 04 May 2011 21:18:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.eahanson.com/?p=37#comment-36862</guid>
		<description>I have used this code in a Chrome extension. See https://github.com/aykevl93/Chrome-Sync.</description>
		<content:encoded><![CDATA[<p>I have used this code in a Chrome extension. See <a href="https://github.com/aykevl93/Chrome-Sync" rel="nofollow">https://github.com/aykevl93/Chrome-Sync</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://www.eahanson.com/2008/12/04/relative-dates-in-javascript/comment-page-1/#comment-36024</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Sun, 10 Apr 2011 21:28:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.eahanson.com/?p=37#comment-36024</guid>
		<description>The code is assuming that if it&#039;s a string, it&#039;s already human-formatted and needs to be parsed. So if the date is &quot;Sun Apr 10 2011&quot;, then &quot;new Date(&#039;Sun Apr 10 2011&#039;)&quot; will parse the string and create the correct date. 

I assume that you have the situation where you have a string representing the number of milliseconds since 1970, such as &quot;1302418800000&quot;. In that case, you definitely would have to parse the int.</description>
		<content:encoded><![CDATA[<p>The code is assuming that if it&#8217;s a string, it&#8217;s already human-formatted and needs to be parsed. So if the date is &#8220;Sun Apr 10 2011&#8243;, then &#8220;new Date(&#8216;Sun Apr 10 2011&#8242;)&#8221; will parse the string and create the correct date. </p>
<p>I assume that you have the situation where you have a string representing the number of milliseconds since 1970, such as &#8220;1302418800000&#8243;. In that case, you definitely would have to parse the int.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayke van Laethem</title>
		<link>http://www.eahanson.com/2008/12/04/relative-dates-in-javascript/comment-page-1/#comment-36022</link>
		<dc:creator>Ayke van Laethem</dc:creator>
		<pubDate>Sun, 10 Apr 2011 19:12:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.eahanson.com/?p=37#comment-36022</guid>
		<description>Thanks!

One correction: when the olderDate is a string, this is needed (see the parseInt):
  if (typeof olderDate == &quot;string&quot;) olderDate = new Date(parseInt(olderDate));
otherwise it won&#039;t work (or am I supposed to do something different?)</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
<p>One correction: when the olderDate is a string, this is needed (see the parseInt):<br />
  if (typeof olderDate == &#8220;string&#8221;) olderDate = new Date(parseInt(olderDate));<br />
otherwise it won&#8217;t work (or am I supposed to do something different?)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

