Dateadd - MACROMEDIA COLDFUSION MX 61-CFML Reference

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

Advertisement

DateAdd

Description
Adds units of time to a date.
Returns
A date/time object.
Category
Date and time functions
Function syntax
DateAdd("datepart", number, "date")
See also
DateConvert, DatePart,
History
ColdFusion MX 6.1: Added the datepart character L or l to represent milliseconds.
Parameters
Parameter
datepart
number
date
Usage
The datepart specifiers
When passing a date/time object as a string, you must enclose it in quotation marks. Otherwise, it
is interpreted as a numeric representation of a date/time object.
Example
<!--- This example shows the use of DateAdd --->
<cfparam name="value" default="70">
<cfparam name="type" default="m">
<!--- if numbers passed, then use those --->
<cfif IsDefined("form.value")>
<cfset value = form.value>
</cfif>
CreateTimeSpan
Description
String:
• yyyy: Year
• q: Quarter
• m: Month
• y: Day of year
• d: Day
• w: Weekday
• ww: Week
• h: Hour
• n: Minute
• s: Second
• l: Millisecond
Number of units of datepart to add to date (positive, to get dates in the future;
negative, to get dates in the past)
Date/time object, in the range 100 AD–9999 AD.
,
, and
add a number of days to a date.
y
d
w
DateAdd
439

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents