<?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; snippet</title>
	<atom:link href="http://h3x.no/tag/snippet/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>Mon, 20 Feb 2012 10:07:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.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 &#8230; <a href="http://h3x.no/2009/08/16/display-clock-each-10-minutes-x-times-forward-in-php">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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>
]]></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>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 18/21 queries in 0.008 seconds using apc

Served from: h3x.no @ 2012-05-21 14:05:27 -->
