<?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: Calculate Date from day of year in PhP</title>
	<atom:link href="http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=calculate-date-from-day-of-year-in-php</link>
	<description>A Software Development Manager&#039;s Blog</description>
	<lastBuildDate>Tue, 24 Jan 2012 03:37:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Cesar Perales</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-6124</link>
		<dc:creator>Cesar Perales</dc:creator>
		<pubDate>Fri, 09 Sep 2011 18:33:29 +0000</pubDate>
		<guid isPermaLink="false">#comment-6124</guid>
		<description>actually the correct function will be 
 
function dayofyear2date( $tDay, $tFormat = &#039;d-m-Y&#039; ) { 
$date = mktime( 0, 0, 0, 1, $tDay+1, date(&#039;Y&#039;) ); 
return date( $tFormat, $date ); 
} 
 
$todayid = date(&quot;z&quot;); // to get today&#039;s day of year 
echo dayofyear2date($todayid);  
 
Beacuse date(&#039;z&#039;) starts from 0 and mktime count the number of days from 1 </description>
		<content:encoded><![CDATA[<p>actually the correct function will be </p>
<p>function dayofyear2date( $tDay, $tFormat = &#039;d-m-Y&#039; ) {<br />
$date = mktime( 0, 0, 0, 1, $tDay+1, date(&#039;Y&#039;) );<br />
return date( $tFormat, $date );<br />
} </p>
<p>$todayid = date(&quot;z&quot;); // to get today&#039;s day of year<br />
echo dayofyear2date($todayid);  </p>
<p>Beacuse date(&#039;z&#039;) starts from 0 and mktime count the number of days from 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-6121</link>
		<dc:creator>Roland</dc:creator>
		<pubDate>Sun, 28 Aug 2011 20:15:48 +0000</pubDate>
		<guid isPermaLink="false">#comment-6121</guid>
		<description>Thx </description>
		<content:encoded><![CDATA[<p>Thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garison</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-6056</link>
		<dc:creator>Garison</dc:creator>
		<pubDate>Thu, 12 May 2011 02:40:33 +0000</pubDate>
		<guid isPermaLink="false">#comment-6056</guid>
		<description>Actually, the right right code would be: 
 
function dayofyear2date( $tDay, $tFormat = &#039;d-m-Y&#039; ) { 
  $date = mktime( 0, 0, 0, 1, $tDay, date(&#039;Y&#039;) ); 
  return date( $tFormat, $date ); 
} 
 
$todayid = date(&quot;z&quot;); // to get today&#039;s day of year 
echo dayofyear2date($todayid);  </description>
		<content:encoded><![CDATA[<p>Actually, the right right code would be: </p>
<p>function dayofyear2date( $tDay, $tFormat = &#039;d-m-Y&#039; ) {<br />
  $date = mktime( 0, 0, 0, 1, $tDay, date(&#039;Y&#039;) );<br />
  return date( $tFormat, $date );<br />
} </p>
<p>$todayid = date(&quot;z&quot;); // to get today&#039;s day of year<br />
echo dayofyear2date($todayid);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Proger_XP</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-6037</link>
		<dc:creator>Proger_XP</dc:creator>
		<pubDate>Sat, 09 Apr 2011 10:41:37 +0000</pubDate>
		<guid isPermaLink="false">#comment-6037</guid>
		<description>Things are even more simple: 
 
  function DayToTimestamp($day, $year = null) { 
    isset($year) or $year = date(&#039;Y&#039;); 
    return strtotime(&quot;1 Jan $year +$day day&quot;); 
  } 
 </description>
		<content:encoded><![CDATA[<p>Things are even more simple: </p>
<p>  function DayToTimestamp($day, $year = null) {<br />
    isset($year) or $year = date(&#039;Y&#039;);<br />
    return strtotime(&quot;1 Jan $year +$day day&quot;);<br />
  }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cristian</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-5098</link>
		<dc:creator>cristian</dc:creator>
		<pubDate>Wed, 10 Nov 2010 18:40:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-5098</guid>
		<description>I could have never figured it out (within 2 or 3 weeks!!), thank you! </description>
		<content:encoded><![CDATA[<p>I could have never figured it out (within 2 or 3 weeks!!), thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S&#252;ha Kozbey</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-4791</link>
		<dc:creator>S&#252;ha Kozbey</dc:creator>
		<pubDate>Fri, 15 Oct 2010 14:56:18 +0000</pubDate>
		<guid isPermaLink="false">#comment-4791</guid>
		<description>Thank you very much, I could&#039;nt find an alternative to your function.. you really saved my time.. </description>
		<content:encoded><![CDATA[<p>Thank you very much, I could&#039;nt find an alternative to your function.. you really saved my time..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Theo van der Sluijs</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-2509</link>
		<dc:creator>Theo van der Sluijs</dc:creator>
		<pubDate>Thu, 03 Jun 2010 17:47:36 +0000</pubDate>
		<guid isPermaLink="false">#comment-2509</guid>
		<description>Thanks Christian, this new code looks great. </description>
		<content:encoded><![CDATA[<p>Thanks Christian, this new code looks great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Sciberras</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-2505</link>
		<dc:creator>Christian Sciberras</dc:creator>
		<pubDate>Thu, 03 Jun 2010 13:15:42 +0000</pubDate>
		<guid isPermaLink="false">#comment-2505</guid>
		<description>Oh, and the right code would be: 
 
function dayofyear2date( $tDay, $tFormat = &#039;d-m-Y&#039; ) { 
    $offset = intval($tDay) * 86400; 
    $date = mktime( 0, 0, 0, 1, 1, date(&#039;Y&#039;) )+$offset; 
    return date( $tFormat, $date ); 
} 
 
$todayid = date(&quot;z&quot;);  // to get today&#039;s day of year 
echo dayofyear2date($todayid); </description>
		<content:encoded><![CDATA[<p>Oh, and the right code would be:</p>
<p>function dayofyear2date( $tDay, $tFormat = &#039;d-m-Y&#039; ) {</p>
<p>    $offset = intval($tDay) * 86400;</p>
<p>    $date = mktime( 0, 0, 0, 1, 1, date(&#039;Y&#039;) )+$offset;</p>
<p>    return date( $tFormat, $date );</p>
<p>}</p>
<p>$todayid = date(&quot;z&quot;);  // to get today&#039;s day of year</p>
<p>echo dayofyear2date($todayid);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deb</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-199</link>
		<dc:creator>deb</dc:creator>
		<pubDate>Sun, 13 Sep 2009 19:44:27 +0000</pubDate>
		<guid isPermaLink="false">#comment-199</guid>
		<description>Thank you ever so much! I was trying to avoid having to recode daily content with a datestamp! This will do the trick nicely without tons of typing. You rock!! </description>
		<content:encoded><![CDATA[<p>Thank you ever so much! I was trying to avoid having to recode daily content with a datestamp! This will do the trick nicely without tons of typing. You rock!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JMP</title>
		<link>http://www.iamboredsoiblog.eu/2008/11/01/calculate-date-from-day-of-year-in-php/#comment-176</link>
		<dc:creator>JMP</dc:creator>
		<pubDate>Mon, 13 Jul 2009 13:22:48 +0000</pubDate>
		<guid isPermaLink="false">#comment-176</guid>
		<description>I needed it for a gantt chart I am (attempting) to develop in Flex.  Works great.  Thanks </description>
		<content:encoded><![CDATA[<p>I needed it for a gantt chart I am (attempting) to develop in Flex.  Works great.  Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
