<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Must be a better way to do this</title>
	<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html</link>
	<description>according to my observations, there is now sufficient reasons for greater optimism</description>
	<pubDate>Fri, 04 Jul 2008 18:48:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: HR</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-236569</link>
		<author>HR</author>
		<pubDate>Sun, 01 Apr 2007 17:08:58 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-236569</guid>
		<description>Damned, I misspelled your name, sorry.</description>
		<content:encoded><![CDATA[<p>Damned, I misspelled your name, sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HR</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-236568</link>
		<author>HR</author>
		<pubDate>Sun, 01 Apr 2007 17:07:05 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-236568</guid>
		<description>@Derrick: well, none of the snippets account for the user's timezone, DST or the exact time the novel will be out but they get the job done, which I believe is the whole point of PHP right? :)</description>
		<content:encoded><![CDATA[<p>@Derrick: well, none of the snippets account for the user&#8217;s timezone, DST or the exact time the novel will be out but they get the job done, which I believe is the whole point of PHP right? <img src='http://www.wormus.com/aaron/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maarten Manders</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-220395</link>
		<author>Maarten Manders</author>
		<pubDate>Sun, 18 Mar 2007 16:49:57 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-220395</guid>
		<description>What about the PHP date class? Or the one in Zend Framework?</description>
		<content:encoded><![CDATA[<p>What about the PHP date class? Or the one in Zend Framework?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derick</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-219879</link>
		<author>Derick</author>
		<pubDate>Sun, 18 Mar 2007 07:41:01 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-219879</guid>
		<description>Everything that uses 86400 is flawed. Not every day is 86400 seconds unfortunately. 

I don't have a solution ready though :)</description>
		<content:encoded><![CDATA[<p>Everything that uses 86400 is flawed. Not every day is 86400 seconds unfortunately. </p>
<p>I don&#8217;t have a solution ready though <img src='http://www.wormus.com/aaron/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-219033</link>
		<author>Rob...</author>
		<pubDate>Sat, 17 Mar 2007 20:07:48 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-219033</guid>
		<description>For Months, I'd do something like:

$finishYear = '2008';
$finishMonth = '07';
$thisYear = date('Y');
$thisMonth = date('m');
$numMonths = ((($finishYear - $thisYear) * 12) + $finishMonth) - $thisMonth;

(With a possible +1 depending on how you want to count!)</description>
		<content:encoded><![CDATA[<p>For Months, I&#8217;d do something like:</p>
<p>$finishYear = &#8216;2008&#8242;;<br />
$finishMonth = &#8216;07&#8242;;<br />
$thisYear = date(&#8217;Y');<br />
$thisMonth = date(&#8217;m');<br />
$numMonths = ((($finishYear - $thisYear) * 12) + $finishMonth) - $thisMonth;</p>
<p>(With a possible +1 depending on how you want to count!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Wormus</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-218476</link>
		<author>Aaron Wormus</author>
		<pubDate>Sat, 17 Mar 2007 15:17:12 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-218476</guid>
		<description>The reason why I went with the double strtotime, was because the last time I did this was counting months, which is more complex.</description>
		<content:encoded><![CDATA[<p>The reason why I went with the double strtotime, was because the last time I did this was counting months, which is more complex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-218225</link>
		<author>Rob...</author>
		<pubDate>Sat, 17 Mar 2007 13:00:29 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-218225</guid>
		<description>$april1st = gmmktime(0, 0, 0, 4, 1, 2007);
$now = gmmktime(0, 0, 0);
$days_remaining = ($april1st - $now) / 86400;</description>
		<content:encoded><![CDATA[<p>$april1st = gmmktime(0, 0, 0, 4, 1, 2007);<br />
$now = gmmktime(0, 0, 0);<br />
$days_remaining = ($april1st - $now) / 86400;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HR</title>
		<link>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-218138</link>
		<author>HR</author>
		<pubDate>Sat, 17 Mar 2007 12:13:11 +0000</pubDate>
		<guid>http://www.wormus.com/aaron/stories/2007/03/17/must-be-a-better-way-to-do-this.html#comment-218138</guid>
		<description>Erm, how about using the difference in seconds divided by the number of seconds per day?

$days = ceil((strtotime('April 1, 2007') - time()) / 86400);

if ($days &#62; 0)
{
	echo $days, (($days == 1) ? ' day' : ' days'), ' left till you can buy Ancestor Novel';
}
else
{
	echo 'Ancestor Novel is available NOW!';
}
</description>
		<content:encoded><![CDATA[<p>Erm, how about using the difference in seconds divided by the number of seconds per day?</p>
<p>$days = ceil((strtotime(&#8217;April 1, 2007&#8242;) - time()) / 86400);</p>
<p>if ($days &gt; 0)<br />
{<br />
	echo $days, (($days == 1) ? &#8216; day&#8217; : &#8216; days&#8217;), &#8216; left till you can buy Ancestor Novel&#8217;;<br />
}<br />
else<br />
{<br />
	echo &#8216;Ancestor Novel is available NOW!&#8217;;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
