createTimespan

Creates a date/time object that defines a time period. You
can add or subtract it from other date/time objects and use
it with the cachedWithin attribute of cfquery.

createTimespan(days, hours, minutes, seconds) → returns DateTime

Argument Reference for the createTimespan function

days

Required: Yes

hours

Required: Yes

minutes

Required: Yes

seconds

Required: Yes

Examples sample code invoking the createTimespan function


Tag Syntax

<!--- This example shows the use of createTimespan with cfquery ---> 
 <cfquery name = "GetParks" datasource = "cfdocexamples" cachedWithin = "#createTimespan(0, 6, 0, 0)#"> 
 SELECT PARKNAME, REGION, STATE 
 FROM Parks 
 ORDER by ParkName, State 
 </cfquery>    

Tag Syntax

<cfoutput>#createTimespan(0, 6, 0, 0)#</cfoutput> 
    

Expected Result: 0.25


Fork me on GitHub