<?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: Snippet: Converting Seconds to Readable Time (PHP &amp; JS)</title>
	<atom:link href="http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/</link>
	<description>Web development blog</description>
	<lastBuildDate>Tue, 07 Feb 2012 10:03:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Alix Axel</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-1902</link>
		<dc:creator>Alix Axel</dc:creator>
		<pubDate>Tue, 18 Oct 2011 19:09:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-1902</guid>
		<description>Even shorter (sorry for repost):

sprintf(&#039;%02u:%02u:%02u&#039;, $secs/3600, $secs%3600/60, $secs%60);</description>
		<content:encoded><![CDATA[<p>Even shorter (sorry for repost):</p>
<p>sprintf(&#8216;%02u:%02u:%02u&#8217;, $secs/3600, $secs%3600/60, $secs%60);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alix Axel</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-1901</link>
		<dc:creator>Alix Axel</dc:creator>
		<pubDate>Tue, 18 Oct 2011 19:06:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-1901</guid>
		<description>Even shorter:

function formatTime($secs) {
	return sprintf(&#039;%02u:%02u:%02u&#039;, floor($secs/3600), floor($secs%3600/60), $secs%60);
}

Please (re)format at will.</description>
		<content:encoded><![CDATA[<p>Even shorter:</p>
<p>function formatTime($secs) {<br />
	return sprintf(&#8216;%02u:%02u:%02u&#8217;, floor($secs/3600), floor($secs%3600/60), $secs%60);<br />
}</p>
<p>Please (re)format at will.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florin Duban</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-1330</link>
		<dc:creator>Florin Duban</dc:creator>
		<pubDate>Mon, 18 Oct 2010 14:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-1330</guid>
		<description>date(&#039;H:i:s&#039;, $secs) when you have less then 25 hours :)

I am searching for something already available in PHP too</description>
		<content:encoded><![CDATA[<p>date(&#8216;H:i:s&#8217;, $secs) when you have less then 25 hours <img src='http://www.ultramegatech.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I am searching for something already available in PHP too</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-827</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 18 Dec 2009 20:06:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-827</guid>
		<description>Good one! Mind if I include that in the post?</description>
		<content:encoded><![CDATA[<p>Good one! Mind if I include that in the post?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Burak</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-824</link>
		<dc:creator>Burak</dc:creator>
		<pubDate>Fri, 18 Dec 2009 19:42:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-824</guid>
		<description>This works too:

&lt;pre lang=&quot;php&quot;&gt;function formatTime($secs) {
	return str_pad(floor($secs/3600),2,&quot;0&quot;,STR_PAD_LEFT).&quot;:&quot;.
		str_pad(floor(($secs%3600)/60),2,&quot;0&quot;,STR_PAD_LEFT).&quot;:&quot;.
		str_pad($secs%60,2,&quot;0&quot;,STR_PAD_LEFT);
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>This works too:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> formatTime<span style="color: #009900;">&#40;</span><span style="color: #000088;">$secs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">str_pad</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$secs</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">,</span>STR_PAD_LEFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #339933;">.</span>
		<span style="color: #990000;">str_pad</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$secs</span><span style="color: #339933;">%</span><span style="color:#800080;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">,</span>STR_PAD_LEFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #339933;">.</span>
		<span style="color: #990000;">str_pad</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$secs</span><span style="color: #339933;">%</span><span style="color:#800080;">60</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">,</span>STR_PAD_LEFT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Trowbridge</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-417</link>
		<dc:creator>Jim Trowbridge</dc:creator>
		<pubDate>Wed, 04 Nov 2009 20:24:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-417</guid>
		<description>WOW!  I couldn&#039;t find this anywhere, thank you... saved a large headache of figuring out the math myself.... I feel like PHP should have a built in function for this (javascript too..) like sectoamt() would be a good name for it ;)

I&#039;m using it to compare two times and return the difference (like a million times).

Thanks again.</description>
		<content:encoded><![CDATA[<p>WOW!  I couldn&#8217;t find this anywhere, thank you&#8230; saved a large headache of figuring out the math myself&#8230;. I feel like PHP should have a built in function for this (javascript too..) like sectoamt() would be a good name for it <img src='http://www.ultramegatech.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I&#8217;m using it to compare two times and return the difference (like a million times).</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Densus88</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-381</link>
		<dc:creator>Densus88</dc:creator>
		<pubDate>Sun, 11 Oct 2009 03:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-381</guid>
		<description>How to convert seconds to YearMonthDateHourMinuteSecond?</description>
		<content:encoded><![CDATA[<p>How to convert seconds to YearMonthDateHourMinuteSecond?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LITTLE STAR: Ethan Cabaniss - StarNewsOnline.com &#124; Webkinz Ganz World</title>
		<link>http://www.ultramegatech.com/2009/06/snippet-converting-seconds-to-readable-time/comment-page-1/#comment-47</link>
		<dc:creator>LITTLE STAR: Ethan Cabaniss - StarNewsOnline.com &#124; Webkinz Ganz World</dc:creator>
		<pubDate>Fri, 05 Jun 2009 16:22:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=395#comment-47</guid>
		<description>[...] Snippet: Converting Seconds to Readable Time (PHP &amp; JS) &#124; UltraMega [...]</description>
		<content:encoded><![CDATA[<p>[...] Snippet: Converting Seconds to Readable Time (PHP &amp; JS) | UltraMega [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

