Datediff - MACROMEDIA COLDFUSION MX 61-CFML Reference

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

Advertisement

DateDiff

Description
Determines the integer number of units by which date1 is less than date2.
Returns
A number of units, of type datepart.
Category
Date and time functions
Function syntax
DateDiff("datepart", "date1", "date2")
See also
DateAdd, DatePart,
History
ColdFusion MX:
Changed how negative date differences are calculated: this function calculates negative date
differences correctly; its output may be different from that in earlier releases.
Changed the
dates.
Parameters
Parameter
datepart
date1
date2
Usage
The
function determines the number of complete datepart units between the two
DateDiff
dates; for example, if the datepart parameter is "m" and the dates differ by 55 days, the function
returns 1.
Enclose string constant dates in quotation marks. If the text contains only numbers (such 1932),
and is not surrounded by quotation marks, ColdFusion interprets it as a date/time object,
resulting in an incorrect value.
CreateTimeSpan
and
attributes; they determine the number of full weeks between the two
w
ww
Description
String specifying the units in which to count; for example yyyy requests a date
difference in whole years.
• yyyy: Years
• q: Quarters
• m: Months
• y: Days of year (same as d)
• d: Days
• w: Weekdays (same as ww)
• ww: Weeks
• h: Hours
• n: Minutes
• s: Seconds
Date/time object, in the range 100 AD–9999 AD.
Date/time object, in the range 100 AD–9999 AD.
DateDiff
445

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents