<?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"
	>
<channel>
	<title>Comments on: One from the archive: resurrecting time_since()</title>
	<atom:link href="http://notes.natbat.net/2007/01/27/timesince/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.natbat.net/2007/01/27/timesince/</link>
	<description>Adventures creations and musings from a girl geek</description>
	<pubDate>Wed, 20 Aug 2008 08:33:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: s. smith</title>
		<link>http://notes.natbat.net/2007/01/27/timesince/#comment-29027</link>
		<dc:creator>s. smith</dc:creator>
		<pubDate>Thu, 02 Aug 2007 16:02:55 +0000</pubDate>
		<guid isPermaLink="false">http://notes.natbat.net/2007/01/27/timesince/#comment-29027</guid>
		<description>In EXCEL, how can you sum up hours and minutes when hours can exceed 24 and minutes can exceed 60.
EX.   23:30
        22:45
sum  46:15</description>
		<content:encoded><![CDATA[<p>In EXCEL, how can you sum up hours and minutes when hours can exceed 24 and minutes can exceed 60.<br />
EX.   23:30<br />
        22:45<br />
sum  46:15</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: developercast.com &#187; Photogapple.co.uk: time_since</title>
		<link>http://notes.natbat.net/2007/01/27/timesince/#comment-12302</link>
		<dc:creator>developercast.com &#187; Photogapple.co.uk: time_since</dc:creator>
		<pubDate>Sat, 21 Apr 2007 16:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://notes.natbat.net/2007/01/27/timesince/#comment-12302</guid>
		<description>[...] On the Photogapple.co.uk blog today, there&#8217;s some handy code that can definitely be useful when working with dates in PHP - a function to find the difference between the current time and a timestamp you give it.   I found it incredibly difficult to find any form of time_since function in php so to save anyone else the trouble to hunting through hundreds of useless websites here is the function you may want to use, written by Natalie Downe (you don&#8217;t want to know how long it took to hunt it down). [...]</description>
		<content:encoded><![CDATA[<p>[...] On the Photogapple.co.uk blog today, there&#8217;s some handy code that can definitely be useful when working with dates in PHP - a function to find the difference between the current time and a timestamp you give it.   I found it incredibly difficult to find any form of time_since function in php so to save anyone else the trouble to hunting through hundreds of useless websites here is the function you may want to use, written by Natalie Downe (you don&#8217;t want to know how long it took to hunt it down). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://notes.natbat.net/2007/01/27/timesince/#comment-12102</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Fri, 20 Apr 2007 01:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://notes.natbat.net/2007/01/27/timesince/#comment-12102</guid>
		<description>You wont believe how long it has taken me to find this code! Every one kept linking to a website that doesn't excist anymore (I guess it was an old one of yours). I am glad I found it tho, helped me out a great deal, thanks.</description>
		<content:encoded><![CDATA[<p>You wont believe how long it has taken me to find this code! Every one kept linking to a website that doesn&#8217;t excist anymore (I guess it was an old one of yours). I am glad I found it tho, helped me out a great deal, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Photogabble &#187; time_since</title>
		<link>http://notes.natbat.net/2007/01/27/timesince/#comment-12100</link>
		<dc:creator>Photogabble &#187; time_since</dc:creator>
		<pubDate>Fri, 20 Apr 2007 01:15:37 +0000</pubDate>
		<guid isPermaLink="false">http://notes.natbat.net/2007/01/27/timesince/#comment-12100</guid>
		<description>[...] I found it incredibly difficult to find any form of time_since function in php so to save anyone else the trouble to hunting through hundereds of useless websites here is the function you may want to use, written by Natalie Downe (you dont want to know how long it took to hunt it down). [...]</description>
		<content:encoded><![CDATA[<p>[...] I found it incredibly difficult to find any form of time_since function in php so to save anyone else the trouble to hunting through hundereds of useless websites here is the function you may want to use, written by Natalie Downe (you dont want to know how long it took to hunt it down). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davee</title>
		<link>http://notes.natbat.net/2007/01/27/timesince/#comment-2058</link>
		<dc:creator>davee</dc:creator>
		<pubDate>Mon, 05 Feb 2007 09:33:40 +0000</pubDate>
		<guid isPermaLink="false">http://notes.natbat.net/2007/01/27/timesince/#comment-2058</guid>
		<description>What perfect timing on this post, Nat: I was looking for something like this for an application being developed at work.  Cheers :-)

davee
The One Who Drove You To LugradioLive2006</description>
		<content:encoded><![CDATA[<p>What perfect timing on this post, Nat: I was looking for something like this for an application being developed at work.  Cheers :-)</p>
<p>davee<br />
The One Who Drove You To LugradioLive2006</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karsten</title>
		<link>http://notes.natbat.net/2007/01/27/timesince/#comment-1648</link>
		<dc:creator>Karsten</dc:creator>
		<pubDate>Sat, 27 Jan 2007 15:54:43 +0000</pubDate>
		<guid isPermaLink="false">http://notes.natbat.net/2007/01/27/timesince/#comment-1648</guid>
		<description>&lt;p&gt;Interesting, I just programmed something like this yesterday. My code looks almost the same...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
function timetostr($duration = 0) {
  // calculate days, hours, minutes, seconds
  $d = (int)($duration/(60*60*24));
  $h = (int)(($duration % (60*60*24))/(60*60));
  $m = (int)(($duration % (60*60))/60);
  $s = (int)($duration % 60);

  // generate output
  $r = \"\";
  $start = \"\";
  if ($d) {
    $r = $d.\" day\".($d == 1 ? \"\" : \"s\");
    $start = \", \";
  }
  if ($h) {
    $r .= $start.$h.\" hour\".($h == 1 ? \"\" : \"s\");
    $start = \", \";
  }
  if ($m) {
    $r .= $start.$m.\" minute\".($m == 1 ? \"\" : \"s\");
    $start = \", \";
  }
  $r .= $start.$s.\" second\".($s == 1 ? \"\" : \"s\");

  return $r;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If I want to have a shorter display, I then use &lt;code&gt;print preg_replace(\"/ ([a-z])[a-z]*,?/\", \"\\${1}\", timetostr($somedate))&lt;/code&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Interesting, I just programmed something like this yesterday. My code looks almost the same&#8230;</p>
<pre><code>
function timetostr($duration = 0) {
  // calculate days, hours, minutes, seconds
  $d = (int)($duration/(60*60*24));
  $h = (int)(($duration % (60*60*24))/(60*60));
  $m = (int)(($duration % (60*60))/60);
  $s = (int)($duration % 60);

  // generate output
  $r = \"\";
  $start = \"\";
  if ($d) {
    $r = $d.\" day\".($d == 1 ? \"\" : \"s\");
    $start = \", \";
  }
  if ($h) {
    $r .= $start.$h.\" hour\".($h == 1 ? \"\" : \"s\");
    $start = \", \";
  }
  if ($m) {
    $r .= $start.$m.\" minute\".($m == 1 ? \"\" : \"s\");
    $start = \", \";
  }
  $r .= $start.$s.\" second\".($s == 1 ? \"\" : \"s\");

  return $r;
}
</code></pre>
<p>If I want to have a shorter display, I then use <code>print preg_replace(\"/ ([a-z])[a-z]*,?/\&#8221;, \&#8221;\\${1}\&#8221;, timetostr($somedate))</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
