<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Another variation on the &quot;time ago&quot; PHP function, use MySQL&#039;s datetime field type</title>
<link>http://www.mdj.us/</link>
<description>A PHP time ago function for formatting the date on post comments or other timestamps.</description>
<language>en</language>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1629</link>
<pubDate>Sun, 26 Feb 2012 18:53:13 +0000</pubDate>
<content:encoded><![CDATA[Hi Eric, <br />
<br />
Yes, it should, you are correct. I'm on the road at the moment, but I will update when I have a chance. <br />
<br />
Thanks for the note.]]></content:encoded>
</item>
<item>
<title>Eric</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1628</link>
<pubDate>Sun, 26 Feb 2012 16:48:40 +0000</pubDate>
<content:encoded><![CDATA[shouldn't [i][b]commentNum[/b] = $offset + $ordinal;[/i] have '$' in front of it?]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1617</link>
<pubDate>Wed, 22 Feb 2012 13:06:54 +0000</pubDate>
<content:encoded><![CDATA[Hi Charles,<br />
<br />
It probably is best practice to declare it first with a null value, but the variable will be created when first called, and it should be called within the if/else. <br />
<br />
Maybe the MySQL datetime you're sending it isn't valid and therefore $retval is never created? In which case, declaring it would simple return a null value I would think. Not really sure how you used it within your own script, but if you've got it working now, it's all good I suppose.]]></content:encoded>
</item>
<item>
<title>Charles</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1616</link>
<pubDate>Tue, 21 Feb 2012 15:28:45 +0000</pubDate>
<content:encoded><![CDATA[My php returned an error. The error said that [b]$retval[/b] did not exist.<br />
<br />
Before using [b]$retval .= ...[/b], shouldn't you declare [b]$retval = '';[/b] beforehand?<br />
<br />
Thanks for the script!]]></content:encoded>
</item>
<item>
<title>Salsan  India</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1507</link>
<pubDate>Sat, 22 Oct 2011 22:12:24 +0000</pubDate>
<content:encoded><![CDATA[thanks for the time ago script. i was doing some r&amp;d to make this.]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1505</link>
<pubDate>Tue, 18 Oct 2011 14:27:29 +0000</pubDate>
<content:encoded><![CDATA[Dan, try changing that code to this;<br />
<br />
$time = time_ago($message['pubdate']);<br />
echo sprintf( __('%s', 'twitter-for-wordpress'),' '.$time);<br />
<br />
Sorry for the slow reply, been crazy busy lately.]]></content:encoded>
</item>
<item>
<title>Dan</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1501</link>
<pubDate>Wed, 12 Oct 2011 13:37:49 +0000</pubDate>
<content:encoded><![CDATA[How do I implement this into the following function?:<br />
<br />
          $time = strtotime($message['pubdate']);<br />
        <br />
          echo sprintf( __('%s', 'twitter-for-wordpress'),' '. date('m/d/Y H:ia', $time). '' );]]></content:encoded>
</item>
<item>
<title>Yogesh</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1496</link>
<pubDate>Tue, 27 Sep 2011 12:48:09 +0000</pubDate>
<content:encoded><![CDATA[Thanks for this, its work perfect for me]]></content:encoded>
</item>
<item>
<title>Joshua F</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1495</link>
<pubDate>Mon, 26 Sep 2011 19:30:01 +0000</pubDate>
<content:encoded><![CDATA[This is better than sex.]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/another-variation-on-the-time-ago-php-function-use-mysqls-datetime-field-type/#comment-1442</link>
<pubDate>Sun, 12 Jun 2011 13:01:51 +0000</pubDate>
<content:encoded><![CDATA[Thanks Aziz! I see now, I was checking the time instead of the difference, I should've looked a little closer. Thanks for posting a solution.<br />
<br />
I have updated it to say &quot;posted just now&quot; when under 5 seconds, the user can change that to 1 second or any other value they like.]]></content:encoded>
</item>
</channel>
</rss>

