How to create a date time object in ColdFusion

CreateDateTime() - create a date time object

CreateDateTime.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CreateDateTime function example: how to create a date time object</title>
</head>

<body>
<h2 style="color:hotpink">CreateDateTime Function Example</h2>

<cfset Year="2008">
<cfset Month="12">
<cfset Day="5">
<cfset Hour="6">
<cfset Minute="30">
<cfset Second="29">
<cfset CreatedDateTime=CreateDateTime(Year,Month,Day,Hour,Minute,Second)>
<cfoutput>
<b>
Year: #Year#
<br />
Month: #Month#
<br />
Day: #Day#
<br />
Hour: #Hour#
<br />
Minute: #Minute#
<br />
Second: #Second#
<br /><br />
Created DateTime: #CreatedDateTime#
</b>
</cfoutput>
</body>
</html>





More ColdFusion examples