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

  1. <!--- This example shows the use of ParseDateTime--->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. ParseDateTime Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BODY bgcolor=silver>
  12.  
  13. <H3>ParseDateTime Example</H3>
  14.  
  15. <CFIF IsDefined("form.theTestValue")>
  16.  
  17.     <CFIF IsDate(form.theTestValue)>
  18.     <H3>The expression <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is a valid date</H3>
  19.     <P>The date, parsed for use as a date/time value: <CFOUTPUT>#ParseDateTime("#form.theTestValue#")#</CFOUTPUT>
  20.  
  21.     <CFELSE>
  22.     <H3>The expression <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is not a valid date</H3>
  23.  
  24.     </CFIF>
  25.  
  26.  
  27. </CFIF>
  28.  
  29. <FORM ACTION="parsedatetime.cfm" METHOD="POST">
  30. <P>Enter an expression, and discover if
  31. it can be evaluated to a date value.
  32.  
  33. <INPUT TYPE="Text" NAME="TheTestValue" VALUE="<CFOUTPUT>#DateFormat("#Now()#")# #TimeFormat("#Now()#")#</CFOUTPUT>">
  34.  
  35. <INPUT TYPE="Submit" VALUE="Parse the Date" NAME="">
  36.  
  37.  
  38. </FORM>
  39.  
  40.  
  41.  
  42. </BODY>
  43.  
  44. </HTML>       
  45.   
  46.