<?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: Making time periods readable</title>
	<atom:link href="http://aidanlister.com/2004/04/making-time-periods-readable/feed/" rel="self" type="application/rss+xml" />
	<link>http://aidanlister.com/2004/04/making-time-periods-readable/</link>
	<description>Code is poetry</description>
	<lastBuildDate>Tue, 31 Jan 2012 07:34:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: PHP: How to make time more readable? &#124; Webdriver</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-3245</link>
		<dc:creator>PHP: How to make time more readable? &#124; Webdriver</dc:creator>
		<pubDate>Mon, 28 Nov 2011 09:26:49 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-3245</guid>
		<description>[...] /** * A function for making time periods readable * * @author Aidan Lister * @version 2.0.1 * @link http://aidanlister.com/2004/04/making-time-periods-readable/ * @param int number of seconds elapsed * @param string which time periods to display * @param bool whether to show zero time periods */ function time_duration($seconds, $use = null, $zeros = false) { // Define time periods $periods = array ( &#039;years&#039; =&gt; 31556926, &#039;Months&#039; =&gt; 2629743, &#039;weeks&#039; =&gt; 604800, &#039;days&#039; =&gt; 86400, &#039;hours&#039; =&gt; 3600, &#039;minutes&#039; =&gt; 60, &#039;seconds&#039; =&gt; 1 ); // Break into periods $seconds = (float) $seconds; $segments = array(); foreach ($periods as $period =&gt; $value) { if ($use &amp;&amp; strpos($use, $period[0]) === false) { continue; } $count = floor($seconds / $value); if ($count == 0 &amp;&amp; !$zeros) { continue; } $segments[strtolower($period)] = $count; $seconds = $seconds % $value; } // Build the string $string = array(); foreach ($segments as $key =&gt; $value) { $segment_name = substr($key, 0, -1); $segment = $value . &#039; &#039; . $segment_name; if ($value != 1) { $segment .= &#039;s&#039;; } $string[] = $segment; } return implode(&#039;, &#039;, $string); }        Tweet   Share     View source [...]</description>
		<content:encoded><![CDATA[<p>[...] /** * A function for making time periods readable * * @author Aidan Lister * @version 2.0.1 * @link <a href="http://aidanlister.com/2004/04/making-time-periods-readable/" rel="nofollow">http://aidanlister.com/2004/04/making-time-periods-readable/</a> * @param int number of seconds elapsed * @param string which time periods to display * @param bool whether to show zero time periods */ function time_duration($seconds, $use = null, $zeros = false) { // Define time periods $periods = array ( &#039;years&#039; =&gt; 31556926, &#039;Months&#039; =&gt; 2629743, &#039;weeks&#039; =&gt; 604800, &#039;days&#039; =&gt; 86400, &#039;hours&#039; =&gt; 3600, &#039;minutes&#039; =&gt; 60, &#039;seconds&#039; =&gt; 1 ); // Break into periods $seconds = (float) $seconds; $segments = array(); foreach ($periods as $period =&gt; $value) { if ($use &amp;&amp; strpos($use, $period[0]) === false) { continue; } $count = floor($seconds / $value); if ($count == 0 &amp;&amp; !$zeros) { continue; } $segments[strtolower($period)] = $count; $seconds = $seconds % $value; } // Build the string $string = array(); foreach ($segments as $key =&gt; $value) { $segment_name = substr($key, 0, -1); $segment = $value . &#039; &#039; . $segment_name; if ($value != 1) { $segment .= &#039;s&#039;; } $string[] = $segment; } return implode(&#039;, &#039;, $string); }        Tweet   Share     View source [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: acevedo miguel &#187; a little bit of me&#8230; &#187; PHP: How to make time more readable?</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-3229</link>
		<dc:creator>acevedo miguel &#187; a little bit of me&#8230; &#187; PHP: How to make time more readable?</dc:creator>
		<pubDate>Fri, 25 Nov 2011 04:19:57 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-3229</guid>
		<description>[...] /** * A function for making time periods readable * * @author Aidan Lister &lt;aidan@php.net&gt; * @version 2.0.1 * @link http://aidanlister.com/2004/04/making-time-periods-readable/ * @param int number of seconds elapsed * @param string which time periods to display * @param bool whether to show zero time periods */ function time_duration($seconds, $use = null, $zeros = false) { // Define time periods $periods = array ( &#039;years&#039; =&gt; 31556926, &#039;Months&#039; =&gt; 2629743, &#039;weeks&#039; =&gt; 604800, &#039;days&#039; =&gt; 86400, &#039;hours&#039; =&gt; 3600, &#039;minutes&#039; =&gt; 60, &#039;seconds&#039; =&gt; 1 ); // Break into periods $seconds = (float) $seconds; $segments = array(); foreach ($periods as $period =&gt; $value) { if ($use &amp;&amp; strpos($use, $period[0]) === false) { continue; } $count = floor($seconds / $value); if ($count == 0 &amp;&amp; !$zeros) { continue; } $segments[strtolower($period)] = $count; $seconds = $seconds % $value; } // Build the string $string = array(); foreach ($segments as $key =&gt; $value) { $segment_name = substr($key, 0, -1); $segment = $value . &#039; &#039; . $segment_name; if ($value != 1) { $segment .= &#039;s&#039;; } $string[] = $segment; } return implode(&#039;, &#039;, $string); }        Tweet   Share     View source [...]</description>
		<content:encoded><![CDATA[<p>[...] /** * A function for making time periods readable * * @author Aidan Lister &lt;aidan@php.net&gt; * @version 2.0.1 * @link <a href="http://aidanlister.com/2004/04/making-time-periods-readable/" rel="nofollow">http://aidanlister.com/2004/04/making-time-periods-readable/</a> * @param int number of seconds elapsed * @param string which time periods to display * @param bool whether to show zero time periods */ function time_duration($seconds, $use = null, $zeros = false) { // Define time periods $periods = array ( &#039;years&#039; =&gt; 31556926, &#039;Months&#039; =&gt; 2629743, &#039;weeks&#039; =&gt; 604800, &#039;days&#039; =&gt; 86400, &#039;hours&#039; =&gt; 3600, &#039;minutes&#039; =&gt; 60, &#039;seconds&#039; =&gt; 1 ); // Break into periods $seconds = (float) $seconds; $segments = array(); foreach ($periods as $period =&gt; $value) { if ($use &amp;&amp; strpos($use, $period[0]) === false) { continue; } $count = floor($seconds / $value); if ($count == 0 &amp;&amp; !$zeros) { continue; } $segments[strtolower($period)] = $count; $seconds = $seconds % $value; } // Build the string $string = array(); foreach ($segments as $key =&gt; $value) { $segment_name = substr($key, 0, -1); $segment = $value . &#039; &#039; . $segment_name; if ($value != 1) { $segment .= &#039;s&#039;; } $string[] = $segment; } return implode(&#039;, &#039;, $string); }        Tweet   Share     View source [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ovidiu U</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-2490</link>
		<dc:creator>Ovidiu U</dc:creator>
		<pubDate>Thu, 24 Feb 2011 14:47:15 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-2490</guid>
		<description>Thank you, great function.</description>
		<content:encoded><![CDATA[<p>Thank you, great function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geetika</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-2443</link>
		<dc:creator>Geetika</dc:creator>
		<pubDate>Tue, 08 Feb 2011 07:08:43 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-2443</guid>
		<description>thnx.....alot.......for sharing......</description>
		<content:encoded><![CDATA[<p>thnx&#8230;..alot&#8230;&#8230;.for sharing&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-2020</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Mon, 01 Nov 2010 14:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-2020</guid>
		<description>Fantastic!!
What would I have to do to add  tenths and hundredths of a second?
Trying to nail down sub-second durations. 
Thanks a bunch!
Mark</description>
		<content:encoded><![CDATA[<p>Fantastic!!<br />
What would I have to do to add  tenths and hundredths of a second?<br />
Trying to nail down sub-second durations.<br />
Thanks a bunch!<br />
Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anya</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-1867</link>
		<dc:creator>Anya</dc:creator>
		<pubDate>Thu, 14 Oct 2010 05:41:18 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-1867</guid>
		<description>thanks for information!</description>
		<content:encoded><![CDATA[<p>thanks for information!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jm</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-1413</link>
		<dc:creator>jm</dc:creator>
		<pubDate>Tue, 20 Apr 2010 18:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-1413</guid>
		<description>I guess you cant post PHP within PHP tags...

echo time_duration(123, &#039;yMd&#039;);
echo time_duration(0);</description>
		<content:encoded><![CDATA[<p>I guess you cant post PHP within PHP tags&#8230;</p>
<p>echo time_duration(123, &#8216;yMd&#8217;);<br />
echo time_duration(0);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jm</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-1412</link>
		<dc:creator>jm</dc:creator>
		<pubDate>Tue, 20 Apr 2010 18:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-1412</guid>
		<description>Just wanted to point out a few bugs I found while working through this script.


</description>
		<content:encoded><![CDATA[<p>Just wanted to point out a few bugs I found while working through this script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nbanba</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-1402</link>
		<dc:creator>nbanba</dc:creator>
		<pubDate>Thu, 01 Apr 2010 19:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-1402</guid>
		<description>Thanks! Very useful.</description>
		<content:encoded><![CDATA[<p>Thanks! Very useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aidan Lister</title>
		<link>http://aidanlister.com/2004/04/making-time-periods-readable/comment-page-1/#comment-1356</link>
		<dc:creator>Aidan Lister</dc:creator>
		<pubDate>Fri, 05 Feb 2010 13:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://aidanlister.com/?p=47#comment-1356</guid>
		<description>toto, both years and months use the astronomical mean. Do you really think your visitors care if you&#039;re half a day off on a date that&#039;s a year away?</description>
		<content:encoded><![CDATA[<p>toto, both years and months use the astronomical mean. Do you really think your visitors care if you&#8217;re half a day off on a date that&#8217;s a year away?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

