Hello everybody,
I'm working on this script to get the date difference between two dates in minutes. After doing that; I want to then deduct/subtract the value returned by the datediff function from another date value.
Here is what I'm trying to do:
Reading the two date values from a table:
cfset timeCallPlacedOnHold = queryTmp.HoldDateTime
cfset timeOnHoldReleased = queryTmp.ReleasedDateTime
For some reason the dates retuned are in this format:
Ex: 2004-09-08 12:28:56.0
I can't understand why it adds the .0 after the time when the value
stored in the database is 2004-09-08
Are your dates in the database date type fields?
If yes, the the dates returned in the query are correct.
Sometimes, having an _expression_ like -totalDateDiff causes problem with lousy typed ColdFusion.
I would suggest you invert the two parameters in dateDiff and forget about the minus sign:
Hi,
I would guess you're running MX6.1, the zero represents milliseconds...
On MX6.1 this will correctly output the difference as 3 seconds.
cfset a=2004-09-08 12:28:56.0
cfset b=2004-09-08 12:28:59.0
cfoutput
pdifference in seconds=#dateDiff(s,a,b)#
/cfoutput
Andrew.
Hello everybody,
I'm
Here's an excerpt direct from ColdFusion Studio's help pages ;)
Thanks. Well, that's what I get for relying on the popup help and the O'Reilly
function reference...
When datepart is Weekday (w), DateDiff returns the number
of weeks between
the two dates. If date1 falls on a Monday,
Platform: CF5/Win2K/IIS5
I'm seeing wierd results from DateDiff when using 'ww' (weeks) as the date part. Can
anyone explain these results?
CFSET d1 = 08/3/2003
CFSET d2 = 08/10/2003
CFOUTPUT
P#DateDiff('ww',d1,d2)#
!--- Result: 1 ---
/CFOUTPUT
CFSET d1 = 08/4/2003
CFSET d2 =
Datediff
Usage
To find the number of days between date1 and date2, use Day of Year or Day.
When datepart is Weekday, DateDiff returns the number of weeks between the two dates.
If date1 falls on a Monday, DateDiff counts the number of Mondays to date2. It counts
date2 but not date1.
:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 1:14 PM
To: CF-Talk
Subject: DateDiff question
Platform: CF5/Win2K/IIS5
I'm seeing wierd results from DateDiff when using 'ww' (weeks) as the date
part. Can anyone explain these results?
CFSET d1 = 08/3/2003
CFSET d2 = 08/10/2003
CFOUTPUT
Paine, The American Crisis
Let's Roll
- Todd Beamer, Flight 93
-Original Message-
From: Lofback, Chris [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 1:14 PM
To: CF-Talk
Subject: DateDiff question
Platform: CF5/Win2K/IIS5
I'm seeing wierd results from DateDiff when using
All:
Is below the best and only way to easily find out how many days are
between 2 dates? Im writing a template for a file backup where files
that are older then 5 day will be deleted and Im not sure what the
easiest best practice approach would be for the days check.
James Blaha wrote:
Is below the best and only way to easily find out how many days are
between 2 dates? Im writing a template for a file backup where files
that are older then 5 day will be deleted and Im not sure what the
easiest best practice approach would be for the days check.
Jochem,
Thanks a million! Does the date format have to be in the -mm-dd format?
Regards,
James Blaha
Jochem van Dieten wrote:
James Blaha wrote:
Is below the best and only way to easily find out how many days are
between 2 dates? Im writing a template for a file backup where files
James Blaha wrote:
Thanks a million! Does the date format have to be in the -mm-dd format?
It doesn't have to be. But you wrote 6/3/03, and I wouldn't know what
date that is. I presume the 03 means 2003, but how about the rest? Is
that March 6 or June 3? Do you know? Does the next
Jochem,
Thanks again! All your points were well made.
Regards,
JB
Jochem van Dieten wrote:
James Blaha wrote:
Thanks a million! Does the date format have to be in the -mm-dd format?
It doesn't have to be. But you wrote 6/3/03, and I wouldn't know what
date that is. I presume
et Seconds = DateDiff("s", Date1, Date2)
cfset Minutes = Seconds MOD 60
cfset Seconds = Seconds - (Minutes * 60)
-Original Message-
From: Double Down [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 30, 2000 10:55 AM
To: House Of Fusion
Subject: DateDiff Question
How do I show more than one date part using DateDiff? I would like to show
hours and minutes.
TEA
DDINC
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
0 10:55 AM
To: House Of Fusion
Subject: DateDiff Question
How do I show more than one date part using DateDiff? I would
like to show
hours and minutes.
TEA
DDINC
--
Archives: http://www.mail-archive.c
I use the following to display how many days until an event date. It only
shows how many days. Is there a way to get it to display how many days,
hours and minutes until the event? It seems I can only get it to display
only days, or only minutes, only seconds ect.
cfset eventdate =
You can get the diff in minutes, and do the math to get the number of
days, hours, and minutes.
-David
On Sat, 29 Apr 2000 19:02:01 -0400 "Jeff Fongemie" [EMAIL PROTECTED]
writes:
I use the following to display how many days until an event date. It
only
shows how many days. Is there a way
19 matches
Mail list logo