Datecompare - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

DateCompare

Performs a full date/time comparison of two dates. Returns -1 if date1 is less than
date2; returns 0 if date1 is equal to date2; returns 1 if date1 is greater than date2. See the
description of datePart for information on specifying the precision of the comparison.
See also
Syntax
DateCompare( date1 , date2 [, datePart ])
date1
Date/time object in the period from 100 AD to 9999 AD.
date2
Date/time object in the period from 100 AD to 9999 AD.
datePart
Optional. The precision of the comparison. This parameter can have any of the
following values:
s - precise to the second.
n- precise to the minute.
h- precise to the hour.
d- precise to the day.
m- precise to the month.
yyyy- precise to the year.
By default, precision is to the second.
Usage
When passing a date/time value as a string, make sure it is enclosed in quotes.
Otherwise, it is interpreted as a number representation of a date/time object, returning
undesired results.
Years from 0 to 29 are interpreted as 21
th
as 20
century values.
Examples
<!--- This example shows the use of datecompare --->
<HTML>
<HEAD>
<TITLE>
DateCompare Example
</TITLE>
</HEAD>
<basefont face="Arial, Helvetica" size=2>
<H3>DateCompare Example</H3>
CreateDateTime
and DatePart.
st
century values. Years 30 to 99 are interpreted
317

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents