<?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 - CFML_Reference - functions-pt158.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-26T06:07:20</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38980" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38979" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38522" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29748" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29232" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29231" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#20856" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#19364" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#12857" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#12848" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#7630" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#851" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#836" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#803" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38980">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38980</link>
		<description>OK - further research has found that apparently datediff('d'....) counts &quot;whole days&quot; and not date boundaries.  This is stupid if you ask me - if I wanted to count the notion of &quot;whole days&quot; - I'd do 24 hours.&lt;br /&gt;&lt;br /&gt;Anyway, a fix I found is to format the days to drop the time.  For instance, if I'm counting the number of days a certain date is from today:&lt;br /&gt;DateDiff('d', DateFormat(variables.mydate, 'mm/dd/yyyy'), now()) would yield 0 for today, 1 for yesterday, etc.  Notice I only do the format on the first date since it basically makes it count as 12am on that day - so anytime today would count as at least a whole day.&lt;br /&gt;&lt;br /&gt;Macromedia: could you please fix this or add a new date part that would count day boundaries?</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-08-26T10:09:53</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38979">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38979</link>
		<description>I'm running CFMX7 - it seems that DateDiff('d', start, end) doesn't count the number of day boundries crossed (as it does in SQL, etc).  For instance:&lt;br /&gt;&lt;br /&gt;DateDiff('d', '8/26/2005 8:00pm', '8/27/2005 9am') returns 0 - instead of 1 (as I would expect).  Are my expectations wrong?</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-08-26T09:59:23</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38522">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#38522</link>
		<description>It seems to me that DateDiff returns the larger of 2 options when asked to calculate over the fall daylight savings.  The following code returns 75, for the number of minutes between 00:45 and 01:00 on Oct 30, 2005.  But 15 would also be a correct answer since 01:00 occurs twice on this day.  And my code is expecting the 15.  Is there anyway to specifiy this difference?&lt;br /&gt;&lt;br /&gt;DateDiff (&quot;n&quot;,CreateDateTime(&quot;2005&quot;,&quot;10&quot;,&quot;30&quot;,&quot;0&quot;,&quot;45&quot;,&quot;0&quot;),CreateDateTime(&quot;2005&quot;,&quot;10&quot;,&quot;30&quot;,&quot;1&quot;,&quot;0&quot;,&quot;0&quot;))&lt;br /&gt;&lt;br /&gt;always returns 75.  What about the other correct answer, 15?</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-08-09T12:13:58</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29748">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29748</link>
		<description>captainplanet: Are you ColdFusion MX or ColdFusion MX 6.1? My understanding is that the DateDiff problem is fixed in the CFMX 6.1 updater: http://www.macromedia.com/support/documentation/en/coldfusion/mx61updater/releasenotes_cfmx61_updater02.html</description>
		<dc:creator>jrunrandy</dc:creator>
		<dc:type>1 0</dc:type>
		<dc:date>2005-03-15T13:40:47</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29232">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29232</link>
		<description>Also, we are fully updated with all the patches.</description>
		<dc:creator>captainplanet</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-03-08T06:45:48</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29231">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#29231</link>
		<description>&lt;cfdump var=&quot;#DateDiff(&quot;d&quot;, createdate(2005,4,1), createdate(2005,5,1))#&quot;&gt; returns 29&lt;br /&gt;&lt;br /&gt;&lt;cfdump var=&quot;#DateDiff(&quot;d&quot;, createdate(2005,4,2), createdate(2005,5,2))#&quot;&gt; returns 29&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;cfdump var=&quot;#DateDiff(&quot;d&quot;, createdate(2005,4,3), createdate(2005,5,3))#&quot;&gt; returns 29&lt;br /&gt;&lt;br /&gt;&lt;cfdump var=&quot;#DateDiff(&quot;d&quot;, createdate(2005,4,4), createdate(2005,5,4))#&quot;&gt; returns 30&lt;br /&gt;&lt;br /&gt;I think this is a problem.  We're writing finacial software &amp; the interest calculation is off because of this problem.  I need some help.......</description>
		<dc:creator>captainplanet</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-03-08T06:44:48</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#20856">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#20856</link>
		<description>the patch worked for me, CFMX Standard 6.1 on win2000</description>
		<dc:creator>godardk</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-09-02T12:03:09</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#19364">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#19364</link>
		<description>this hotfix didn't work on my mx 6.1</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-08-03T03:53:20</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#12857">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#12857</link>
		<description>Are you running ColdFusion MX or ColdFusion MX 6.1? AFAIK, DateDiff works OK in CFMX. For 6.1, there is a hot fix to the DateDiff function: http://www.macromedia.com/support/coldfusion/ts/documents/duplicate_hotfix.htm</description>
		<dc:creator>jrunrandy</dc:creator>
		<dc:type>1 0</dc:type>
		<dc:date>2004-04-13T07:49:38</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#12848">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#12848</link>
		<description>I am trying to use datedif to calc age. &lt;br /&gt;DATEDIF(yyyy,14-Apr-1996,13-Apr-2004) = 8&lt;br /&gt;whereas in every other language i use it gives 7 years.&lt;br /&gt;Why is this?</description>
		<dc:creator>WatVduck</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-04-13T03:25:35</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#7630">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#7630</link>
		<description>DateDiff applies daylight savings differences to Day Of Year (&quot;y&quot;) and Day (&quot;d&quot;) calculations, and this leads to non-intuitive results. Viz:&lt;br /&gt;&lt;br /&gt;(The first date of the datediff is during daylight savings time, the second date is not; The first datediff uses 10:30pm and 0:00, the second datediff uses 11:30pm and 0:00)&lt;br /&gt;#DateDiff(&quot;d&quot;, CreateDate(2003, 10, 25), CreateDateTime(2004, 2, 6, 22, 24, 0))#&lt;br /&gt;#DateDiff(&quot;d&quot;, CreateDate(2003, 10, 25), CreateDateTime(2004, 2, 6, 23, 30, 0))#&lt;br /&gt;&lt;br /&gt;The first one returns 104, the second 105.&lt;br /&gt;&lt;br /&gt;Move the date so BOTH are NOT during daylight savings:&lt;br /&gt;&lt;br /&gt;#DateDiff(&quot;d&quot;, CreateDate(2003, 10, 27), CreateDateTime(2004, 2, 6, 22, 24, 0))#&lt;br /&gt;#DateDiff(&quot;d&quot;, CreateDate(2003, 10, 27), CreateDateTime(2004, 2, 6, 23, 30, 0))#&lt;br /&gt;&lt;br /&gt;And they both return the same 102.&lt;br /&gt;&lt;br /&gt;To further perplex the issue, the intuitive way to make the above first result happen would be to convert the local datetime to UTC (11:30 daylight savings is really 12:30 the next day, so when converting to UTC, it would make sense for there to be a difference between 10:30pm and 11:30 pm). HOWEVER, when you do this, instead what happens is that there is no longer any difference in the output between daylight-savings days and non-daylight-savings days:&lt;br /&gt;&lt;br /&gt;#DateDiff(&quot;y&quot;, DateConvert(&quot;Local2utc&quot;,CreateDate(2003, 10, 25)), DateConvert(&quot;Local2utc&quot;,CreateDateTime(2004, 2, 6, 22, 24, 0)))#&lt;br /&gt;#DateDiff(&quot;y&quot;, DateConvert(&quot;Local2utc&quot;,CreateDate(2003, 10, 25)), DateConvert(&quot;Local2utc&quot;,CreateDateTime(2004, 2, 6, 23, 30, 0)))#&lt;br /&gt;&lt;br /&gt;returns 105 for both, and:&lt;br /&gt;&lt;br /&gt;#DateDiff(&quot;y&quot;, DateConvert(&quot;Local2utc&quot;,CreateDate(2003, 10, 27)), DateConvert(&quot;Local2utc&quot;,CreateDateTime(2004, 2, 6, 22, 24, 0)))#&lt;br /&gt;#DateDiff(&quot;y&quot;, DateConvert(&quot;Local2utc&quot;,CreateDate(2003, 10, 27)), DateConvert(&quot;Local2utc&quot;,CreateDateTime(2004, 2, 6, 23, 30, 0)))#&lt;br /&gt;&lt;br /&gt;returns 102 for both.</description>
		<dc:creator>Hutz</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-02-09T07:56:18</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#851">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#851</link>
		<description>Just FYI: This bug is fixed in update pack 1.</description>
		<dc:creator>clu@oncallinteractiv</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2003-01-10T18:28:00</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#836">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#836</link>
		<description>I think it's buggin in CFMX. Try this on a MX machine:&lt;br&gt;&lt;br&gt;#DateDiff('m','1/1/1999','3/1/1999')# = 1 &lt;br&gt;#DateDiff('m','1/1/1999','3/2/1999')# = 1 &lt;br&gt;#DateDiff('m','1/1/1999','3/3/1999')# = 2 &lt;br&gt;#DateDiff('m','1/1/1999','3/31/1999')# = 2 &lt;br&gt;&lt;br&gt;</description>
		<dc:creator>clu@oncallinteractiv</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2003-01-07T19:42:00</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#803">
		<title>coldfusion/6/CFML_Reference/functions-pt158.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt158.htm#803</link>
		<description>this function has changed since coldfusion 5&lt;br&gt;the result of&lt;br&gt;#dateDiff(&quot;m&quot;,&quot;1/1/2002&quot;,&quot;12/1/2002&quot;)# was 11&lt;br&gt;in MX it is 10&lt;br&gt;&lt;br&gt;</description>
		<dc:creator>daveline</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2002-12-12T20:58:00</dc:date>
	</item>
	</rdf:RDF>

