CREATEDATE  
説明

日付時刻オブジェクトを作成します。

 
戻り値

日付時刻の値

 
カテゴリ

日付および時刻関数

 
関数のシンタックス
CreateDate(year, month, day)
 
関連項目

CreateDateTime、CreateODBCDate、『ColdFusion MX 開発ガイド』の第3章の「ColdFusion 変数の使用」 の「ODBC がサポートされていない場合の日付時刻関数およびクエリー」

 
パラメータ

 
使用方法

CreateDate は CreateDateTime のサブセットです。

返されたオブジェクトの時刻は 00:00:00 に設定されます。

 
<h3>CreateDate の例</h3>
<CFIF IsDefined("form.year")>
<p>CreateDate で生成された日付値 :
<CFSET yourDate = CreateDate(form.year, form.month, form.day)>
<cfoutput>
<ul>
   <li>CreateDate で設定した形式 :#CreateDate(form.year, form.month, form.day)#
   <li>CreateDateTime で設定した形式 :#CreateDateTime(form.year, form.month,
form.day, 12,13,0)#
   <li>CreateODBCDate で設定した形式 :#CreateODBCDate(yourDate)#
   <li>CreateODBCDateTime で設定した形式 :#CreateODBCDateTime(yourDate)#
</ul>

<p>同じ値を、DateFormat で形式設定できます。
<ul>
   <li>CreateDate および DateFormat で設定した形式 : 
         #DateFormat(CreateDate(form.year, form.month, form.day), "mmm-dd-yyyy")#
   <li>CreateDateTime および DateFormat で設定した形式 : 
         #DateFormat(CreateDateTime(form.year, form.month, form.day, 12,13,0))#
   <li>CreateODBCDate および DateFormat で設定した形式 : 
         #DateFormat(CreateODBCDate(yourDate), "mmmm d, yyyy")#
   <li>CreateODBCDateTime および DateFormat で設定した形式 : 
         #DateFormat(CreateODBCDateTime(yourDate), "d/m/yy")#
</ul>
</cfoutput>
</CFIF>
<CFFORM ACTION="createdate.cfm" METHOD="POST">
<p>年、月、および日を整数で入力します。
<PRE>
年   <CFINPUT TYPE="Text" NAME="year" VALUE="1998" VALIDATE="integer"
      REQUIRED="Yes">
月   <CFINPUT TYPE="Text" NAME="month" VALUE="6" VALIDATE="integer"
      REQUIRED="Yes">
日   <CFINPUT TYPE="Text" NAME="day" VALUE="8" VALIDATE="integer"
      REQUIRED="Yes">
</PRE>
<p><INPUT TYPE="Submit" NAME=""> <INPUT TYPE="RESET">
</cfform>
YEAR  
0 〜 9999 の範囲の整数です。0 〜 29 の範囲の整数は 2000 〜 2029 に変換されます。30 〜 99 の範囲の整数は 1930 〜 1999 に変換されます。西暦 100 年より前の日付は指定できません。
MONTH  
1 (1 月) 〜 12 (12 月) の範囲の整数です。
DAY  
1 〜 31 の範囲の整数です。