<?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>SliQTools Software Development Blog &#187; PHP</title>
	<atom:link href="http://www.sliqtools.co.uk/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sliqtools.co.uk/blog</link>
	<description>Software Tips and Snippets</description>
	<lastBuildDate>Fri, 16 Dec 2011 11:17:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Splitting a time value into day, hour, mins, secs in PHP</title>
		<link>http://www.sliqtools.co.uk/blog/php/splitting-a-time-value-into-day-hour-mins-secs-in-php/</link>
		<comments>http://www.sliqtools.co.uk/blog/php/splitting-a-time-value-into-day-hour-mins-secs-in-php/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 06:36:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.sliqtools.co.uk/blog/php/splitting-a-time-value-into-day-hour-mins-secs-in-php/</guid>
		<description><![CDATA[I&#8217;ve been writing a new webpage that calculates the time left before a user license period expires. I wanted to display the time as a countdown of the number of days left before the license runs out. I couldn&#8217;t find an off-the-shelf PHP function to do the job so I quickly wrote the function below.

/* [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been writing a new webpage that calculates the time left before a user license period expires. I wanted to display the time as a countdown of the number of days left before the license runs out. I couldn&#8217;t find an off-the-shelf PHP function to do the job so I quickly wrote the function below.<br />
<code><br />
/* This function takes a PHP time value and returns the duration as an array<br />
with 4 elements -<br />
element 0 = days<br />
element 1 = hours<br />
element 2 = minutes<br />
element 3 = seconds<br />
*/<br />
function DurationInDHMS($timeduration)<br />
{<br />
    $days = floor($timeduration / 86400);<br />
    $timeduration = $timeduration - ($days * 86400);<br />
    $hours = floor($timeduration / 3600);<br />
    $timeduration = $timeduration - ($hours * 3600);<br />
    $minutes = floor($timeduration / 60);<br />
    $seconds = $timeduration - ($minutes * 60);<br />
    return array($days, $hours, $minutes, $seconds);<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sliqtools.co.uk/blog/php/splitting-a-time-value-into-day-hour-mins-secs-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

