Createtimespan - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

CreateTimeSpan

Description
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
Returns
A date/time object.
Category
Date and time functions
Function syntax
CreateTimeSpan(days, hours, minutes, seconds)
See also
CreateDateTime, DateAdd,
Parameters
Parameter
days
hours
minutes
seconds
Usage
Creates a special date/time object that should be used only to add and subtract from other date/
time objects or with the
If you use the
cachedWithin
time span you define, cached query data is used. In this case, the
used to define a period of time from the present backwards. The
effect only if you enable query caching in the ColdFusion Administrator. For more information,
see
.
cfquery
Example
<!--- This example shows the use of CreateTimeSpan with cfquery --->
<h3>CreateTimeSpan Example</h3>
<!--- define startrow and maxrows to facilitate 'next N' style browsing --->
<cfparam name = "MaxRows" default = "10">
<cfparam name = "StartRow" default = "1">
<!--- Query database for information, if cached database information has not
been
updated in the last six hours. -------->
<cfoutput>
<cfquery name = "GetParks" datasource = "cfsnippets"
cachedWithin = "#CreateTimeSpan(0, 6, 0, 0)#">
SELECT
PARKNAME, REGION, STATE
FROM
Parks
ORDER by ParkName, State
</cfquery>
</cfoutput>
436
Chapter 3: ColdFusion Functions
cachedWithin
DateConvert
Description
Integer in the range 0–32768; number of days in time period
Number of hours in time period
Number of minutes in time period
Number of seconds in time period
cfquery
cachedWithin
attribute of
attribute of
cfquery
attribute.
, and the original query date falls within the
cfquery
.
function is
CreateTimeSpan
attribute takes
cachedWithin

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents