User Guide

Table Of Contents
Strings 49
Boolean values
A Boolean value represents whether something is true or false. ColdFusion has two special
constants—True and False—to represent these values. For example, the Boolean expression 1 IS 1
evaluates to True. The expression
"Monkey" CONTAINS "Money" evaluates to False.
You can use Boolean constants directly in expressions, as in the following example:
<cfset UserHasBeenHere = True>
In Boolean expressions, True, nonzero numbers, and the string “Yes” are equivalent, and False, 0,
and the string “No” are equivalent.
In Boolean expressions, True, nonzero numbers, and the strings “Yes”, “1|”, “True” are equivalent;
and False, 0, and the strings “No”, “0”, and “False” are equivalent.
Boolean evaluation is not case-sensitive. For example, True, TRUE, and true are equivalent.
Date-Time values
ColdFusion can perform operations on date and time values. Date-time values identify a date and
time in the range 100 AD to 9999 AD. Although you can specify just a date or a time,
ColdFusion uses one data type representation, called a date-time object, for date, time, and date
and time values.
ColdFusion provides many functions to create and manipulate date-time values and to return all
or part of the value in several different formats.
You can enter date and time values directly in a
cfset tag with a constant, as follows:
<cfset myDate = "October 30, 2001">
When you do this, ColdFusion stores the information as a string. If you use a date-time function,
ColdFusion stores the value as a date-time object, which is a separate simple data type. When
possible, use date-time functions such as
CreateDate and CreateTime to specify dates and times,
because these functions can prevent you from specifying the date or time in an invalid format and
they create a date-time object immediately.