<?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: PHP : Date difference in days</title>
	<atom:link href="http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/</link>
	<description>Web Development Resources</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:42:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: ramon</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-8796</link>
		<dc:creator>ramon</dc:creator>
		<pubDate>Fri, 02 Dec 2011 02:45:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-8796</guid>
		<description>php script &gt;&gt; 
How to get the number of hours and minutes of a two set of time like this sample.

1st set of time : 8:00 to 17:00
2nd set of time : 9:00 to 18:00
range of time  : 8hrs

another sample

1st set of time : 20:00 to 4:00
2nd set of time : 22:00 to 6:00
range of time  : 6hrs

please can someone help me. :3</description>
		<content:encoded><![CDATA[<p>php script &gt;&gt;<br />
How to get the number of hours and minutes of a two set of time like this sample.</p>
<p>1st set of time : 8:00 to 17:00<br />
2nd set of time : 9:00 to 18:00<br />
range of time  : 8hrs</p>
<p>another sample</p>
<p>1st set of time : 20:00 to 4:00<br />
2nd set of time : 22:00 to 6:00<br />
range of time  : 6hrs</p>
<p>please can someone help me. :3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fantastic way to find day difference between 2 times in PHP &#124; Whoila Blog</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-7536</link>
		<dc:creator>Fantastic way to find day difference between 2 times in PHP &#124; Whoila Blog</dc:creator>
		<pubDate>Mon, 02 May 2011 07:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-7536</guid>
		<description>[...] http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/" rel="nofollow">http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arun prashar</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-7437</link>
		<dc:creator>arun prashar</dc:creator>
		<pubDate>Sun, 20 Feb 2011 11:49:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-7437</guid>
		<description>i did&#039;nt find here any code want to notify to my dear webmaster to make it complete</description>
		<content:encoded><![CDATA[<p>i did&#8217;nt find here any code want to notify to my dear webmaster to make it complete</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pong Lenis</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-7058</link>
		<dc:creator>Pong Lenis</dc:creator>
		<pubDate>Mon, 13 Sep 2010 05:13:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-7058</guid>
		<description>This is even easier:

$days = floor((strtotime(&quot;$otherdate&quot;) - strtotime(&quot;$today&quot;))/86400);

Output is in days.</description>
		<content:encoded><![CDATA[<p>This is even easier:</p>
<p>$days = floor((strtotime(&#8220;$otherdate&#8221;) &#8211; strtotime(&#8220;$today&#8221;))/86400);</p>
<p>Output is in days.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamp Mark</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-1173</link>
		<dc:creator>Jamp Mark</dc:creator>
		<pubDate>Thu, 08 Jul 2010 15:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-1173</guid>
		<description>can&#039;t find the code...
anyways, to get the difference in days excluding time, do this
$days = abs(strtotime(date(&#039;Y-m-d&#039;,$timeTo)) - strtotime(date(&#039;Y-m-d&#039;, $timeFrom)));</description>
		<content:encoded><![CDATA[<p>can&#8217;t find the code&#8230;<br />
anyways, to get the difference in days excluding time, do this<br />
$days = abs(strtotime(date(&#8216;Y-m-d&#8217;,$timeTo)) &#8211; strtotime(date(&#8216;Y-m-d&#8217;, $timeFrom)));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandip Layek</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-957</link>
		<dc:creator>Sandip Layek</dc:creator>
		<pubDate>Wed, 28 Apr 2010 12:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-957</guid>
		<description>$dateDiff = strtotime($totdate) - strtotime($frmtdate);
$fullDays = floor($dateDiff/(60*60*24));
echo &#039;The difference between these dates is&#039;.$fullDays;</description>
		<content:encoded><![CDATA[<p>$dateDiff = strtotime($totdate) &#8211; strtotime($frmtdate);<br />
$fullDays = floor($dateDiff/(60*60*24));<br />
echo &#8216;The difference between these dates is&#8217;.$fullDays;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbn</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-864</link>
		<dc:creator>sbn</dc:creator>
		<pubDate>Thu, 18 Mar 2010 10:29:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-864</guid>
		<description>Here the simple PHP code to get the date difference in days.It subtract the given date from current date and returns the different in days.

function nicetime($date)
{
    if(empty($date)) {
        return &quot;No date provided&quot;;
    }
   
    $periods         = array(&quot;second&quot;, &quot;minute&quot;, &quot;hour&quot;, &quot;day&quot;, &quot;week&quot;, &quot;month&quot;, &quot;year&quot;, &quot;decade&quot;);
    $lengths         = array(&quot;60&quot;,&quot;60&quot;,&quot;24&quot;,&quot;7&quot;,&quot;4.35&quot;,&quot;12&quot;,&quot;10&quot;);
   
    $now             = time();
    $unix_date         = strtotime($date);
   
       // check validity of date
    if(empty($unix_date)) {   
        return &quot;Bad date&quot;;
    }

    // is it future date or past date
    if($now &gt; $unix_date) {   
        $difference     = $now - $unix_date;
       
    } else {
        $difference     = $unix_date - $now;
    }

    return floor($difference/(60*60*24));
}

$date = &quot;2010-03-09&quot;;
$result = nicetime($date); // 2 days ago
echo $result;</description>
		<content:encoded><![CDATA[<p>Here the simple PHP code to get the date difference in days.It subtract the given date from current date and returns the different in days.</p>
<p>function nicetime($date)<br />
{<br />
    if(empty($date)) {<br />
        return &#8220;No date provided&#8221;;<br />
    }</p>
<p>    $periods         = array(&#8220;second&#8221;, &#8220;minute&#8221;, &#8220;hour&#8221;, &#8220;day&#8221;, &#8220;week&#8221;, &#8220;month&#8221;, &#8220;year&#8221;, &#8220;decade&#8221;);<br />
    $lengths         = array(&#8220;60&#8243;,&#8221;60&#8243;,&#8221;24&#8243;,&#8221;7&#8243;,&#8221;4.35&#8243;,&#8221;12&#8243;,&#8221;10&#8243;);</p>
<p>    $now             = time();<br />
    $unix_date         = strtotime($date);</p>
<p>       // check validity of date<br />
    if(empty($unix_date)) {<br />
        return &#8220;Bad date&#8221;;<br />
    }</p>
<p>    // is it future date or past date<br />
    if($now &gt; $unix_date) {<br />
        $difference     = $now &#8211; $unix_date;</p>
<p>    } else {<br />
        $difference     = $unix_date &#8211; $now;<br />
    }</p>
<p>    return floor($difference/(60*60*24));<br />
}</p>
<p>$date = &#8220;2010-03-09&#8243;;<br />
$result = nicetime($date); // 2 days ago<br />
echo $result;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbn</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-863</link>
		<dc:creator>sbn</dc:creator>
		<pubDate>Thu, 18 Mar 2010 06:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-863</guid>
		<description>Hey,
Where is ur code?</description>
		<content:encoded><![CDATA[<p>Hey,<br />
Where is ur code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radha</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-851</link>
		<dc:creator>Radha</dc:creator>
		<pubDate>Sat, 13 Mar 2010 05:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-851</guid>
		<description>That is the lightest script I have ever seen.. or not seenThat is the lightest script I have ever seen.. or not seenThat is the lightest script I have ever seen.. or not seen</description>
		<content:encoded><![CDATA[<p>That is the lightest script I have ever seen.. or not seenThat is the lightest script I have ever seen.. or not seenThat is the lightest script I have ever seen.. or not seen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radha</title>
		<link>http://www.lost-in-code.com/programming/php-code/php-date-difference-in-days/comment-page-1/#comment-850</link>
		<dc:creator>Radha</dc:creator>
		<pubDate>Sat, 13 Mar 2010 05:32:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/?p=45#comment-850</guid>
		<description>That is the lightest script I have ever seen.. or not seen</description>
		<content:encoded><![CDATA[<p>That is the lightest script I have ever seen.. or not seen</p>
]]></content:encoded>
	</item>
</channel>
</rss>

