Chapter 2: ColdFusion Functions
321
<CFSET yourDate = CreateDateTime(FORM.year, FORM.month, FORM.day,
FORM.hour,FORM.minute, FORM.second)>
<P><CFOUTPUT>Your date value, presented as a ColdFusion date-time
string:#yourdate#.</CFOUTPUT></P>
<CFSET yourUTC = DateConvert("local2utc", yourDate)>
<P><CFOUTPUT>Your date and time value, converted into Universal
Coordinated Time (UTC): #yourUTC#.</CFOUTPUT></P>
<P><CFOUTPUT>Your UTC date and time, converted back to local date and
time: #DateConvert("utc2local", yourUTC)#.</CFOUTPUT></P>
<CFELSE>
Type the date and time, and press Enter to see the conversion.
</CFIF>
<Hr size="2" color="#0000A0">
<FORM ACTION="dateconvert.cfm" METHOD="POST">
<P>Please enter the year, month and day in integer format for
the date value you would like to view:
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td>Year</td>
<td><INPUT TYPE="Text" NAME="year" VALUE="1998" VALIDATE="integer"
REQUIRED="Yes"></td>
</tr>
<tr>
<td>Month</td>
<td><INPUT TYPE="Text" NAME="month" VALUE="6" RANGE="1,12"
MESSAGE="Please enter a month (1-12)" VALIDATE="integer"
REQUIRED="Yes"></td>
</tr>
<tr>
<td>Day</td>
<td><INPUT TYPE="Text" NAME="day" VALUE="8" RANGE="1,31"
MESSAGE="Please enter a day of the month (1-31)" VALIDATE="integer"
REQUIRED="Yes"></td>
</tr>
<tr>
<td>Hour</td>
<td><INPUT TYPE="Text" NAME="hour" VALUE="16" RANGE="0,23"
MESSAGE="You must enter an hour (0-23)" VALIDATE="integer"
REQUIRED="Yes"></td>
</tr>
<tr>
<td>Minute</td>
<td><INPUT TYPE="Text" NAME="minute" VALUE="12" RANGE="0,59"
MESSAGE="You must enter a minute value (0-59)" VALIDATE="integer"
REQUIRED="Yes"></td>
</tr>
<tr>
<td>Second</td>
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...