home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / createdate.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  1.7 KB  |  60 lines

  1. <!--- This example shows how to use Createdate,
  2. Createdatetime, and createODBCdate --->
  3.  
  4. <HTML>
  5.  
  6. <HEAD>
  7. <TITLE>
  8. CreateDate Example
  9. </TITLE>
  10. </HEAD>
  11.  
  12. <BODY bgcolor=silver>
  13.  
  14. <H3>CreateDate Example</H3>
  15.  
  16. <CFIF IsDefined("form.year")>
  17. Your date value, presented using different CF date functions:
  18. <CFSET yourDate = #CreateDate("#form.year#","#form.month#","#form.day#")#>
  19.  
  20. <CFOUTPUT>
  21. <UL>
  22.     <LI>Built with CreateDate: #CreateDate("#form.year#","#form.month#","#form.day#")#
  23.     <LI>Built with CreateDateTime: #CreateDateTime("#form.year#","#form.month#","#form.day#", 12,13,0)#
  24.     <LI>Built with CreateODBCDate: #CreateODBCDate("#yourDate#")#
  25.     <LI>Built with CreateODBCDateTime: #CreateODBCDateTime("#yourDate#")#
  26. </UL>
  27.  
  28. <P>The same value can be formatted with dateFormat:
  29. <UL>
  30.     <LI>Built with CreateDate: #DateFormat("#CreateDate("#form.year#","#form.month#","#form.day#")#", "mmm-dd-yyyy")#
  31.     <LI>Built with CreateDateTime: #DateFormat("#CreateDateTime("#form.year#","#form.month#","#form.day#", 12,13,0)#")#
  32.     <LI>Built with CreateODBCDate: #DateFormat("#CreateODBCDate("#yourDate#")#", "mmmm d, yyyy")#
  33.     <LI>Built with CreateODBCDateTime: #DateFormat("#CreateODBCDateTime("#yourDate#")#", "d/m/yy")#
  34. </UL>
  35.  
  36.  
  37. </CFOUTPUT>
  38.  
  39. </CFIF>
  40.  
  41.  
  42. <CFFORM ACTION="createdate.cfm" METHOD="POST">
  43. <P>Please enter the year, month and day in integer format for 
  44. the date value you would like to view:
  45. <PRE>
  46. Year    <CFINPUT TYPE="Text" NAME="year" VALUE="1998" VALIDATE="integer" REQUIRED="Yes">
  47. Month    <CFINPUT TYPE="Text" NAME="month" VALUE="6" VALIDATE="integer" REQUIRED="Yes">
  48. Day    <CFINPUT TYPE="Text" NAME="day" VALUE="8" VALIDATE="integer" REQUIRED="Yes">
  49. </PRE>
  50. <P><INPUT TYPE="Submit" NAME=""> <INPUT TYPE="RESET">
  51.  
  52.  
  53. </CFFORM>
  54.  
  55.  
  56.  
  57. </BODY>
  58.  
  59. </HTML>       
  60.