Whatever message this page gives is out now! Go check it out!
| Value | As Boolean | As number | As date-time | As string |
"Yes" | True | 1 | Error | "Yes" |
"No" | False | 0 | Error | "No" |
True | True | 1 | Error | "Yes" |
False | False | 0 | Error | "No" |
Number | True if Number is not 0; False otherwise. | Number | See "Date-time values" earlier in this chapter. | String representation of the number (for example, "8"). |
String | If "Yes", TrueIf "No", FalseIf it can be converted to 0, FalseIf it can be converted to any other number, True | If it represents a number (for example, "1,000" or "12.36E-12"), it is converted to the corresponding number. If it represents a date-time (see next column), it is converted to the numeric value of the corresponding date-time object. | If it is an ODBC date, time, or timestamp (for example "{ts '2001-06-14 11:30:13'}", or if it is expressed in a standard U.S. date or time format, including the use of full or abbreviated month names, it is converted to the corresponding date-time value. Days of the week or unusual punctuation result in an error. Dashes, forward-slashes, and spaces are generally allowed. | String |
Date | Error | The numeric value of the date-time object. | Date | An ODBC timestamp. |
Use cfoutput to display the result of the now function:<br>
<cfoutput>#mynow#</cfoutput><br>
Now add 0 to the result and display it again:<br>
<cfset mynow = mynow + 0>
<cfoutput>#mynow#</cfoutput>{ts '2003-06-03 13:06:44'}
Now add 0 to the result and display it again:
37775.5463426<cfoutput>myVariable equals #myVariable# and is True
</cfoutput>
</cfif>
<cfif myVariable IS True>
<cfoutput>myVariable equals #myVariable# and is True
</cfoutput>
</cfif><cfoutput>myVariable equals #myVariable# and IS NOT False
</cfoutput>
</cfif>| Expression | Interpretation |
<cfif "1a" EQ "01:00"> | If 1:00am is 1:00am. |
<cfif "1P" GT "2A"> | If 1:00pm is later than 2:00am. |
<cfset age="4a"><cfset age=age + 7> | Treat the variable age as 4:00 am, convert it to the date-time value 0.16666666667, and add 7 to make it 7.16666666667. |
<cfif "0.0" is "0"> | If 0 is 0. |
SELECT *
FROM DateQuery
WHERE MyDate >= '#DateFormat(Now())#'
</cfquery>SELECT *
FROM DateQuery
WHERE MyDate >= '#now()#'
</cfquery><cfset emp.SetJobGrade(JavaCast("int", JobGrade))>2 * True + "YES" - ('y' & "es")"Five is " & 5 |
DateFormat("October 30, 2001" + 1) |