Createdatetime - MACROMEDIA COLDFUSION MX 61-CFML Reference

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

Advertisement

CreateDateTime

Description
Creates a date-time object.
Returns
A date/time value.
Category
Date and time functions
Function syntax
CreateDateTime(year, month, day, hour, minute, second)
See also
CreateDate, CreateTime, CreateODBCDateTime,
Parameters
Parameter
year
month
day
hour
minute
second
Example
<h3>CreateDateTime Example</h3>
<CFIF IsDefined("form.year")>
Your date value, generated with CreateDateTime:
<CFSET yourDate = CreateDateTime(form.year, form.month, form.day,
form.hour, form.minute, form.second)>
<cfoutput>
<ul>
<li>Formatted with CreateDate: #CreateDate(form.year, form.month, form.day)#
<li>Formatted with CreateDateTime: #CreateDateTime(form.year, form.month,
form.day, form.hour, form.minute, form.second)#
<li>Formatted with CreateODBCDate: #CreateODBCDate(yourDate)#
<li>Formatted with CreateODBCDateTime: #CreateODBCDateTime(yourDate)#
</ul>
<p>The same value can be formatted with DateFormat:
<ul>
<li>Formatted with CreateDate and DateFormat:
#DateFormat(CreateDate(form.year, form.month, form.day), "mmm-dd-yyyy")#
<li>Formatted with CreateDateTime and DateFormat:
#DateFormat(CreateDateTime(form.year, form.month, form.day,
form.hour, form.minute, form.second))#
Description
Integer in the range 0-9999. Integers in the range 0-29 are converted to 2000-
2029. Integers in the range 30-99 are converted to 1930-1999. You cannot
specify dates before AD 100.
Integer in the range 1 (January)–12 (December)
Integer in the range 1–31
Integer in the range 0–23
Integer in the range 0–59
Integer in the range 0–59
Now
CreateDateTime
421

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents