<?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>Riding The Breeze &#187; javascript</title>
	<atom:link href="http://www.iliveinperego.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iliveinperego.com</link>
	<description>Yes !</description>
	<lastBuildDate>Fri, 12 Feb 2010 09:46:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add days to a date in javascript</title>
		<link>http://www.iliveinperego.com/2007/05/add-days-to-a-date-in-javascript/</link>
		<comments>http://www.iliveinperego.com/2007/05/add-days-to-a-date-in-javascript/#comments</comments>
		<pubDate>Wed, 30 May 2007 15:20:57 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Things I forget]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/add-days-to-a-date-in-javascript</guid>
		<description><![CDATA[shiftDay = 10
var myDate = new Date();
myDate.setDate(myDate.getUTCDate() + shiftDay)
day   = myDate.getUTCDate()
month = myDate.getUTCMonth()*1 + 1
year  = myDate.getUTCFullYear()
This code is quite easy: 

shiftDay hold the number of days you want to add, if you need to go backwards you can set it to a negative value.
myDate is set to the current date
At the end we will [...]]]></description>
			<content:encoded><![CDATA[<p><code>shiftDay = 10<br />
var myDate = new Date();<br />
myDate.setDate(myDate.getUTCDate() + shiftDay)<br />
day   = myDate.getUTCDate()<br />
month = myDate.getUTCMonth()*1 + 1<br />
year  = myDate.getUTCFullYear()</code></p>
<p>This code is quite easy<em>: </em></p>
<ul>
<li><em>shiftDay</em> hold the number of days you want to add, if you need to go backwards you can set it to a negative value.</li>
<li><em>myDate</em> is set to the current date</li>
<li>At the end we will have the data we need in <em>day</em>, <em>month</em> and <em>year.</em></li>
<li><em>getUTCMonth</em> return the current month shifted back by one (January is 0, February is 1 and so on) that&#039;s why we add 1. We multiply the value returned by <em>getUTCMonth</em> by one to cast it to integer.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2007/05/add-days-to-a-date-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
