<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - coldfusion - 6.1 - htmldocs - functi58.htm</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T18:33:21</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#54899" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#29376" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19859" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19747" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19365" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19363" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11659" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11420" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11391" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#4949" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#1843" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#1842" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#54899">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#54899</link>
		<description>startDate = CreateDateTime (2006, 10, 13, 8, 0, 0); // Oct. 13, 2006, 8:00 AM&lt;br /&gt;endDate = CreateDateTime (2006, 10, 14, 0, 0, 0); // Oct. 14, 2006, 12:00 AM&lt;br /&gt;ctDays = DateDiff (&quot;d&quot;, startDate, endDate); // equals 0&lt;br /&gt;&lt;br /&gt;endDate = CreateDateTime (2006, 10, 14, 8, 0, 0); // Oct. 14, 2006, 8:00 AM&lt;br /&gt;ctDays = DateDiff (&quot;d&quot;, startDate, endDate); // equals 1&lt;br /&gt;&lt;br /&gt;Day differences are calculated by diffing the hours and then dividing by 24. I initially thought this function would tell me that there is a 1 day difference in my first example.</description>
		<dc:creator>redtopia</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2006-10-23T09:42:00</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#29376">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#29376</link>
		<description>I agree with clementi, it is not clear when dateDiff will return negative or positive results, and the example requires dates to be entered, so it has to be run.&lt;br /&gt;Something you could just look at and see 'ah right' would be better.&lt;br /&gt;Maybe a table with a few example values for the two dates and the result codes.</description>
		<dc:creator>TomChiv</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-03-10T01:39:08</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19859">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19859</link>
		<description>guintato is correct. &lt;br&gt;DateDiff ignores the time when calculating differences in units greater than days.&lt;br&gt;We have filed bug number 56889 against this behavior.</description>
		<dc:creator>halL</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2004-08-10T12:51:09</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19747">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19747</link>
		<description>It seems to me that DateDiff doesn't consider the time when calculating years (similar results occur for months, and weeks):&lt;br /&gt;&lt;br /&gt;&lt;cfscript&gt;&lt;br /&gt;  dtCompDate  = CreateDateTime(2002,11,5,17,45,0);&lt;br /&gt;  dtToday     = CreateDateTime(2004,11,5,17,44,0);&lt;br /&gt;  iYears      = DateDiff(&quot;yyyy&quot;,dtCompDate,dtToday);  &lt;br /&gt;&lt;/cfscript&gt;&lt;br /&gt;&lt;br /&gt;&lt;cfoutput&gt;&lt;br /&gt;  Compare Date: #DateFormat(dtCompDate,&quot;mmmm d, yyyy&quot;)# #TimeFormat(dtCompDate,&quot;h:m tt&quot;)#&lt;br&gt;&lt;br /&gt;  Today's Date: #DateFormat(dtToday,&quot;mmmm d, yyyy&quot;)# #TimeFormat(dtToday,&quot;h:m tt&quot;)#&lt;br&gt;&lt;br /&gt;  The number of years between these dates is #iYears#&lt;br&gt;&lt;br /&gt;  Expected answer is 1&lt;br /&gt;&lt;/cfoutput&gt;&lt;br /&gt;&lt;br /&gt;Has anyone else encountered this problem, and if so how did you resolve it? Comments will be greatly appreciated.</description>
		<dc:creator>guintato</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-08-08T12:01:19</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19365">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19365</link>
		<description>I used this code to test:&lt;br /&gt;&lt;br /&gt;setlocale(&quot;dutch (standard)&quot;);&lt;br /&gt;writeoutput(DateDiff('s', CreateDateTime(1970,1,1,0,0,0), CreateDateTime(2004,6,6,0,0,0)));&lt;br /&gt;&lt;br /&gt;Results:&lt;br /&gt;CF5: 1086480000&lt;br /&gt;CFMX unpatched: 1086476400 &lt;br /&gt;CFMX with hotfix 53813: 1086476400 &lt;br /&gt;&lt;br /&gt;There's still 1 hour time difference</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-08-03T04:34:37</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19363">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#19363</link>
		<description>Installed the hotfix, there's still a 1 hour time difference for datediff between CF5 and MX server.</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-08-03T03:39:53</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11659">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11659</link>
		<description>Go to http://www.macromedia.com/support/coldfusion/ts/documents/duplicate_hotfix.htm to get a hotfix that addresses the daylight savings time bug.</description>
		<dc:creator>jrunrandy</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-03-24T06:35:41</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11420">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11420</link>
		<description>This error arises from Daylights Savings time ( There are only 23 hours between 4/4/2004 and 4/5/2004, so it doesn't get counted as a whole day ). The Round( DateDiff ('h'... ) / 24 ) works well, though it's annoying that this hasn't been hotfixed yet.</description>
		<dc:creator>GreyLurk</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-03-19T16:04:47</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11391">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#11391</link>
		<description>Somebody posted a very helpful function on one of the other forums. This function returns the number of days between two dates, and solved the problem I was having with DateDiff().&lt;br /&gt;&lt;br /&gt;&lt;cffunction name=&quot;fixedDateDiff&quot;&lt;br /&gt;            hint=&quot;This function fixes a bug in the 1.4.2 JVM that causes DateDiff to not &lt;br /&gt;                  work for certain dates (4/07/2003 or 4/5/2004 or 4/4/2005). I discovered &lt;br /&gt;                  this on the Macromedia LiveDocs for DateDiff in CF 6.1, after Joe found &lt;br /&gt;                  an issue with the vacpac submit process that occured for April dates only.&lt;br /&gt;                  &lt;br /&gt;                  This function returns the number of days between one date and another.&quot;&lt;br /&gt;            returntype=&quot;numeric&quot;&gt;&lt;br /&gt;   &lt;cfargument name=&quot;data1&quot; type=&quot;date&quot; required=&quot;true&quot;&gt;&lt;br /&gt;   &lt;cfargument name=&quot;data2&quot; type=&quot;date&quot; required=&quot;true&quot;&gt;&lt;br /&gt;&lt;br /&gt;   &lt;cfreturn round(dateDiff('h', data1, data2) / 24)&gt;&lt;br /&gt;&lt;/cffunction&gt;</description>
		<dc:creator>spindlenine</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-03-19T13:27:05</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#4949">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#4949</link>
		<description>In the description above, how about this instead: &quot;Subtracts _date1_ from _date2_ and returns the result in units of _datepart_.&quot;</description>
		<dc:creator>clementi</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-01-07T14:34:28</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#1843">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#1843</link>
		<description>This is bug 53252 and seems to be related to the 1.4.2 JVM.</description>
		<dc:creator>jrunrandy</dc:creator>
		<dc:type>1 0</dc:type>
		<dc:date>2003-09-11T11:10:08</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#1842">
		<title>coldfusion/6.1/htmldocs/functi58.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi58.htm#1842</link>
		<description>Datediff seems to calculate the &lt;br /&gt;wrong number of days if the &lt;br /&gt;dates span 4/07/2003 or &lt;br /&gt;4/5/2004 or 4/4/2005 and &lt;br /&gt;probably more. (In 6.1 only.)&lt;br /&gt;&lt;br /&gt;&lt;cfset DateSeed = &quot;01/01/2003&quot;&gt;&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;Date1&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Date2&lt;/td&gt;&lt;br /&gt;&lt;td&gt;X&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Days Diff&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;cfloop from=&quot;0&quot; to=&quot;1000&quot; index=&quot;y&quot;&gt;&lt;br /&gt;&lt;cfset Date1 = DateAdd(&quot;d&quot;, y, DateSeed)&gt;&lt;br /&gt;&lt;cfloop from=&quot;0&quot; to=&quot;200&quot; index=&quot;x&quot;&gt;&lt;br /&gt;&lt;cfset Date2 = DateAdd(&quot;d&quot;, x, Date1)&gt;&lt;br /&gt;&lt;cfset DaysDiff = datediff(&quot;D&quot;,Date1,DateFormat(Date2,&quot;mm/dd/yyyy&quot;))&gt;&lt;br /&gt;&lt;cfif X neq DaysDiff&gt;&lt;br /&gt;&lt;cfoutput&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;#DateFormat(Date1,&quot;mm/dd/yyyy&quot;)#&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;#DateFormat(Date2,&quot;mm/dd/yyyy&quot;)#&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;#x#&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;#DaysDiff#&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/cfoutput&gt;&lt;br /&gt;&lt;cfbreak&gt;&lt;br /&gt;&lt;/cfif&gt;&lt;br /&gt;&lt;/cfloop&gt;&lt;br /&gt;&lt;/cfloop&gt;&lt;br /&gt;&lt;/table&gt;</description>
		<dc:creator>CFGumby</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2003-09-11T09:56:01</dc:date>
	</item>
	</rdf:RDF>

