How to create an ODBC date time object in ColdFusion

CreateODBCDateTime() - create an ODBC date time object

CreateODBCDateTime.cfm


<!DOCTYPE html>

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

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

<cfset MyDateTime="10-Feb-2008 03:06:09">
<cfset MyAnotherDateTime="5-Dec-2007 00:01:01">

<cfset MyODBCDateTime=CreateODBCDateTime(MyDateTime)>
<cfset MyAnotherODBCDateTime=CreateODBCDateTime(MyAnotherDateTime)>

<cfoutput>
<b>
MyDateTime: #MyDateTime#
<br />
MyODBCDateTime: #MyODBCDateTime#
<br /><br />
MyAnotherDateTime: #myAnotherDateTime#
<br />
MyAnotherODBCDateTime: #myAnotherODBCDateTime#
</b>
</cfoutput>
</body>
</html>





Related ColdFusion examples