<?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: PHP function that returns the exact age</title>
	<atom:link href="http://tympanus.net/codrops/2009/08/30/php-function-that-returns-the-exact-age/feed/" rel="self" type="application/rss+xml" />
	<link>http://tympanus.net/codrops/2009/08/30/php-function-that-returns-the-exact-age/</link>
	<description>Useful resources and inspiration for creative minds</description>
	<lastBuildDate>Wed, 08 Feb 2012 19:26:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: JB</title>
		<link>http://tympanus.net/codrops/2009/08/30/php-function-that-returns-the-exact-age/comment-page-1/#comment-14022</link>
		<dc:creator>JB</dc:creator>
		<pubDate>Thu, 06 Jan 2011 20:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://tympanus.net/codrops/?p=89#comment-14022</guid>
		<description>The code from Mary is a bit complicated and is wrong (if the locale is not GMT it might produce false result).

The code from Adam is wrong as well as it doesn&#039;t take leap years into account.

function age($year, $month, $day) {
$y = date(&#039;Y&#039;);
$m = date(&#039;m&#039;);
$d = date(&#039;d&#039;);

$age = $y - $year;

if( ($m &lt; $month) &#124;&#124; ($m == $month &amp;&amp; $d &lt; $day) )
{
$age--;
}

return $age;
}</description>
		<content:encoded><![CDATA[<p>The code from Mary is a bit complicated and is wrong (if the locale is not GMT it might produce false result).</p>
<p>The code from Adam is wrong as well as it doesn&#8217;t take leap years into account.</p>
<p>function age($year, $month, $day) {<br />
$y = date(&#8216;Y&#8217;);<br />
$m = date(&#8216;m&#8217;);<br />
$d = date(&#8216;d&#8217;);</p>
<p>$age = $y &#8211; $year;</p>
<p>if( ($m &lt; $month) || ($m == $month &amp;&amp; $d &lt; $day) )<br />
{<br />
$age&#8211;;<br />
}</p>
<p>return $age;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Ziaja</title>
		<link>http://tympanus.net/codrops/2009/08/30/php-function-that-returns-the-exact-age/comment-page-1/#comment-8599</link>
		<dc:creator>Adam Ziaja</dc:creator>
		<pubDate>Tue, 16 Nov 2010 19:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://tympanus.net/codrops/?p=89#comment-8599</guid>
		<description>$intCurrentDateStamp = time();
        $intBirthStamp = mktime( 0, 0, 0, 12, 24, 1986 );
        $intAge = $intCurrentDateStamp - $intBirthStamp;
        echo round( ( ( ( ( $intAge / 60 ) / 60 ) / 24 ) / 365 ) );</description>
		<content:encoded><![CDATA[<p>$intCurrentDateStamp = time();<br />
        $intBirthStamp = mktime( 0, 0, 0, 12, 24, 1986 );<br />
        $intAge = $intCurrentDateStamp &#8211; $intBirthStamp;<br />
        echo round( ( ( ( ( $intAge / 60 ) / 60 ) / 24 ) / 365 ) );</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP function that returns the exact age</title>
		<link>http://tympanus.net/codrops/2009/08/30/php-function-that-returns-the-exact-age/comment-page-1/#comment-38</link>
		<dc:creator>PHP function that returns the exact age</dc:creator>
		<pubDate>Thu, 10 Sep 2009 19:24:13 +0000</pubDate>
		<guid isPermaLink="false">http://tympanus.net/codrops/?p=89#comment-38</guid>
		<description>[...] Follow this link: PHP function that returns the exact age [...]</description>
		<content:encoded><![CDATA[<p>[...] Follow this link: PHP function that returns the exact age [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  tympanus.net/codrops/2009/08/30/php-function-that-returns-the-exact-age/feed/ ) in 0.19177 seconds, on Feb 9th, 2012 at 12:00 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 1:00 am UTC -->
