<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - substracting days from Date]]></title>
		<link>http://railsforum.com/viewtopic.php?id=1162</link>
		<description><![CDATA[The most recent posts in substracting days from Date.]]></description>
		<lastBuildDate>Fri, 10 Nov 2006 16:23:32 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: substracting days from Date]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=5795#p5795</link>
			<description><![CDATA[<p>Ok...I tried that initially and I was getting an error. But now I realize why I was getting that error. I was getting my offset from a params field, which resulted essentially in trying to substract a string from Date.today.<br /><pre name="code" class="ruby:nogutter">Date.today - offset</pre><br />Instead, I tried:<br /><pre name="code" class="ruby:nogutter">Date.today - offset.to_i</pre><br />which is working perfectly.</p><p>Thank you!</p>]]></description>
			<author><![CDATA[dummy@example.com (Jammer1982)]]></author>
			<pubDate>Fri, 10 Nov 2006 16:23:32 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=5795#p5795</guid>
		</item>
		<item>
			<title><![CDATA[Re: substracting days from Date]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=5792#p5792</link>
			<description><![CDATA[<p>Try </p><p><pre name="code" class="ruby:nogutter">Date.today - 10</pre></p>]]></description>
			<author><![CDATA[dummy@example.com (thabenksta)]]></author>
			<pubDate>Fri, 10 Nov 2006 16:14:57 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=5792#p5792</guid>
		</item>
		<item>
			<title><![CDATA[substracting days from Date]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=5791#p5791</link>
			<description><![CDATA[<p>I would like to go back 14 days (or months, or years) from today&#039;s date. How would I do that?</p><p>I tried <pre name="code" class="ruby:nogutter">Date.today.day - 10</pre><br />. This returns the days minus 10 days, but does not return the whole date. So for example, if today&#039;s date is 2006-11-10 and I want to go back 14 days, I want the date to be returned as 2006-10-27. Format doesn&#039;t matter. I am just using &#039;YYYY-MM-DD&#039;.</p><p>Thanks for the help!</p>]]></description>
			<author><![CDATA[dummy@example.com (Jammer1982)]]></author>
			<pubDate>Fri, 10 Nov 2006 15:45:41 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=5791#p5791</guid>
		</item>
	</channel>
</rss>
