<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web 3.0, 6 Bladed Razors, 7 Minute Abs &#187; Propel</title>
	<atom:link href="http://www.zachleat.com/web/tag/propel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachleat.com/web</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 01:59:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>PHP Pretty Date</title>
		<link>http://www.zachleat.com/web/2008/02/10/php-pretty-date/</link>
		<comments>http://www.zachleat.com/web/2008/02/10/php-pretty-date/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 21:13:21 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Dates]]></category>
		<category><![CDATA[Propel]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2008/02/10/php-pretty-date/</guid>
		<description><![CDATA[This class is pretty much a direct port of John Resig&#8217;s JavaScript Pretty Date to PHP 5. A few notes: Requires PHP >= 5.10, due to the usage of PHP&#8217;s new DateTimeclass. The new DateTime object parses strings using PHP&#8217;s strtotime, so you don&#8217;t need to pass in an ISO8601 formatted date, as in JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>This class is pretty much a direct port of <a href="http://ejohn.org/blog/javascript-pretty-date/">John Resig&#8217;s JavaScript Pretty Date</a> to PHP 5.  A few notes:</p>
<ul>
<li>Requires PHP >= 5.10, due to the usage of PHP&#8217;s new <a href="http://us3.php.net/manual/en/function.date-create.php">DateTime</a>class.</li>
<li>The new DateTime object parses strings using PHP&#8217;s <a href="http://us3.php.net/manual/en/function.strtotime.php">strtotime</a>, so you don&#8217;t need to pass in an ISO8601 formatted date, as in JavaScript Pretty Date. Try &#8220;now&#8221;, or &#8220;next Wednesday&#8221;, or &#8220;+2 weeks 4 days 23 hours 9 seconds&#8221;.</li>
<li>Extended to handle Months and Years in the past (JavaScript version only goes to weeks)</li>
</ul>
<p>Usage:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// pass in a String DateTime, compared to another String DateTime (defaults to now)</span>
<span style="color: #000088;">$myString</span> <span style="color: #339933;">=</span> Date_Difference<span style="color: #339933;">::</span><span style="color: #004000;">getStringResolved</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-7 weeks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$myString</span> <span style="color: #339933;">=</span> Date_Difference<span style="color: #339933;">::</span><span style="color: #004000;">getStringResolved</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-7 weeks'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'+1 week'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// pass in a DateTime object, compared to another DateTime object (defaults to now)</span>
<span style="color: #666666; font-style: italic;">// useful with the Propel ORM, which uses DateTime objects internally.</span>
<span style="color: #000088;">$myString</span> <span style="color: #339933;">=</span> Date_Difference<span style="color: #339933;">::</span><span style="color: #004000;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-7 weeks'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$myString</span> <span style="color: #339933;">=</span> Date_Difference<span style="color: #339933;">::</span><span style="color: #004000;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-7 weeks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'+1 week'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a href="http://www.zachleat.com/Projects/phpPrettyDate/Date_Difference.phps">Download PHP Pretty Date</a> (PHP 5.10+, 1.86KB)<br />
<a href="http://www.zachleat.com/Projects/phpPrettyDate/Date_Difference.phps">http://www.zachleat.com/Projects/phpPrettyDate/Date_Difference.phps</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2008/02/10/php-pretty-date/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
