<?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>h3x.no &#187; time</title>
	<atom:link href="http://h3x.no/tag/time/feed" rel="self" type="application/rss+xml" />
	<link>http://h3x.no</link>
	<description>Tor Henning Ueland`s thoughts about technology and other stuff</description>
	<lastBuildDate>Wed, 25 Aug 2010 21:22:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Display clock each 10 minutes x times forward in PHP</title>
		<link>http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php</link>
		<comments>http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php#comments</comments>
		<pubDate>Sun, 16 Aug 2009 18:23:44 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.h3x.no/?p=104</guid>
		<description><![CDATA[Here is a simple code PHP snippet to display the clock each 10 minutes x times in the format of: php5 test.php 20:40 20:50 21:00 21:10 21:20 21:30 21:40 Etc. &#60;?php $j = 0; for($i=0;$i&#60;10;$i+=1) { $j += (10*60); $hour = date("H", (time()+$j)); $min = ceil((date("i", (time()+$j))/10))*10; if($min &#62; 50) { $min = "00"; $hour++; [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple code PHP snippet to display the clock each 10 minutes x times in the format of:</p>
<blockquote><p>
php5 test.php<br />
20:40<br />
20:50<br />
21:00<br />
21:10<br />
21:20<br />
21:30<br />
21:40</p></blockquote>
<p>Etc.</p>
<p><!-- Generator: GNU source-highlight 2.11.1<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt><span style="color: #990000;">&lt;?php</span>

<span style="color: #009900;">$j</span> <span style="color: #990000;">=</span> <span style="color: #993399;">0</span><span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">for</span></strong><span style="color: #990000;">(</span><span style="color: #009900;">$i</span><span style="color: #990000;">=</span><span style="color: #993399;">0</span><span style="color: #990000;">;</span><span style="color: #009900;">$i</span><span style="color: #990000;">&lt;</span><span style="color: #993399;">10</span><span style="color: #990000;">;</span><span style="color: #009900;">$i</span><span style="color: #990000;">+=</span><span style="color: #993399;">1</span><span style="color: #990000;">)</span> <span style="color: #ff0000;">{</span>
        <span style="color: #009900;">$j</span> <span style="color: #990000;">+=</span> <span style="color: #990000;">(</span><span style="color: #993399;">10</span><span style="color: #990000;">*</span><span style="color: #993399;">60</span><span style="color: #990000;">);</span>
        <span style="color: #009900;">$hour</span> <span style="color: #990000;">=</span> <strong><span style="color: #000000;">date</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"H"</span><span style="color: #990000;">,</span> <span style="color: #990000;">(</span><strong><span style="color: #000000;">time</span></strong><span style="color: #990000;">()+</span><span style="color: #009900;">$j</span><span style="color: #990000;">));</span>
        <span style="color: #009900;">$min</span>  <span style="color: #990000;">=</span> <strong><span style="color: #000000;">ceil</span></strong><span style="color: #990000;">((</span><strong><span style="color: #000000;">date</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"i"</span><span style="color: #990000;">,</span> <span style="color: #990000;">(</span><strong><span style="color: #000000;">time</span></strong><span style="color: #990000;">()+</span><span style="color: #009900;">$j</span><span style="color: #990000;">))/</span><span style="color: #993399;">10</span><span style="color: #990000;">))*</span><span style="color: #993399;">10</span><span style="color: #990000;">;</span>
        <strong><span style="color: #0000ff;">if</span></strong><span style="color: #990000;">(</span><span style="color: #009900;">$min</span> <span style="color: #990000;">&gt;</span> <span style="color: #993399;">50</span><span style="color: #990000;">)</span> <span style="color: #ff0000;">{</span>
                <span style="color: #009900;">$min</span> <span style="color: #990000;">=</span> <span style="color: #ff0000;">"00"</span><span style="color: #990000;">;</span>
                <span style="color: #009900;">$hour</span><span style="color: #990000;">++;</span>
        <span style="color: #ff0000;">}</span>
        <strong><span style="color: #0000ff;">echo</span></strong> <span style="color: #009900;">$hour</span><span style="color: #990000;">.</span><span style="color: #ff0000;">":"</span><span style="color: #990000;">.</span><span style="color: #009900;">$min</span><span style="color: #990000;">.</span><span style="color: #ff0000;">"\n"</span><span style="color: #990000;">;</span>
<span style="color: #ff0000;">}</span>

<span style="color: #990000;">?&gt;</span>
</tt></pre>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php&amp;title=Display+clock+each+10+minutes+x+times+forward+in+PHP" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php&amp;title=Display+clock+each+10+minutes+x+times+forward+in+PHP" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=Display+clock+each+10+minutes+x+times+forward+in+PHP&amp;body=Link: http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Here%20is%20a%20simple%20code%20PHP%20snippet%20to%20display%20the%20clock%20each%2010%20minutes%20x%20times%20in%20the%20format%20of%3A%0D%0A%0D%0Aphp5%20test.php%0D%0A20%3A40%0D%0A20%3A50%0D%0A21%3A00%0D%0A21%3A10%0D%0A21%3A20%0D%0A21%3A30%0D%0A21%3A40%0D%0AEtc.%0D%0A%0D%0A%0D%0A%26lt%3B%3Fphp%0D%0A%0D%0A%24j%20%3D%200%3B%0D%0Afor%28%24i%3D0%3B%24i%26lt%3B10%3B%24i%2B%3D1%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%24j%20%2B%3D%20%2810%2A60%29%3B%0D%0A%20%20%20%20%20%20%20%20%24hour%20%3D%20date%28%22H%22%2C%20%28time%28%29%2B%24j%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24min" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php&amp;title=Display+clock+each+10+minutes+x+times+forward+in+PHP" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php&amp;title=Display+clock+each+10+minutes+x+times+forward+in+PHP" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Display+clock+each+10+minutes+x+times+forward+in+PHP+-+http://b2l.me/akb637&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
