<?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: Caveat using dateDiff() to compare difference in days</title>
	<atom:link href="http://www.chapter31.com/2008/11/03/caveat-using-datediff-to-compare-difference-in-days/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chapter31.com/2008/11/03/caveat-using-datediff-to-compare-difference-in-days/</link>
	<description>Rich Internet Application development</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:10:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dave DuPlantis</title>
		<link>http://www.chapter31.com/2008/11/03/caveat-using-datediff-to-compare-difference-in-days/comment-page-1/#comment-79876</link>
		<dc:creator>Dave DuPlantis</dc:creator>
		<pubDate>Mon, 03 Nov 2008 13:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=484#comment-79876</guid>
		<description>That&#039;s a good practice no matter where you are: it&#039;s common to want only the date part (or only the time part, in some cases), and for the most part, grabbing only the piece you need will work.

You do want to be careful with those operations, just as you would with regular numbers. fix(date) will give you the date on which a certain event occurred, and fix(date1) - fix(date2) will tell you the difference on the calendar between two events, but if you need to know the number of full days that have elapsed between events, you should use fix (date1 - date2). 

Example: if date1 is November 3, 2008 3:00 AM, and date 2 is November 1, 2008 6:00 PM (1 day 18 hours), fix(date1) - fix(date2) = 2, and fix(date1 - date2) = 1.</description>
		<content:encoded><![CDATA[<p>That&#8217;s a good practice no matter where you are: it&#8217;s common to want only the date part (or only the time part, in some cases), and for the most part, grabbing only the piece you need will work.</p>
<p>You do want to be careful with those operations, just as you would with regular numbers. fix(date) will give you the date on which a certain event occurred, and fix(date1) &#8211; fix(date2) will tell you the difference on the calendar between two events, but if you need to know the number of full days that have elapsed between events, you should use fix (date1 &#8211; date2). </p>
<p>Example: if date1 is November 3, 2008 3:00 AM, and date 2 is November 1, 2008 6:00 PM (1 day 18 hours), fix(date1) &#8211; fix(date2) = 2, and fix(date1 &#8211; date2) = 1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seb Duggan</title>
		<link>http://www.chapter31.com/2008/11/03/caveat-using-datediff-to-compare-difference-in-days/comment-page-1/#comment-79855</link>
		<dc:creator>Seb Duggan</dc:creator>
		<pubDate>Mon, 03 Nov 2008 09:38:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=484#comment-79855</guid>
		<description>I&#039;ve found the best way to do what you&#039;re trying to do is this:

diff = Fix(date1) - Fix(date2)

ColdFusion date/times are basically decimal numbers; the integer part is the date, the decimal part is the time. So the above code would give you a difference of 1 day even if the two dates were only separated by a few minutes either side of midnight.

I think I originally picked up this tip from Ben Nadel...</description>
		<content:encoded><![CDATA[<p>I&#8217;ve found the best way to do what you&#8217;re trying to do is this:</p>
<p>diff = Fix(date1) &#8211; Fix(date2)</p>
<p>ColdFusion date/times are basically decimal numbers; the integer part is the date, the decimal part is the time. So the above code would give you a difference of 1 day even if the two dates were only separated by a few minutes either side of midnight.</p>
<p>I think I originally picked up this tip from Ben Nadel&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: chapter31.nfshost.com @ 2012-02-10 13:31:44 -->
