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

  1. <!--- This example shows information available from datePart --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. DatePart Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <CFSET todayDate = #Now()#>
  12. <BODY>
  13.  
  14. <H3>DatePart Example</H3>
  15.  
  16. <P>Today's date is <CFOUTPUT>#todayDate#</CFOUTPUT>.
  17.  
  18. <P>Using datepart, we can extract an integer representing
  19. the various dateparts from that value
  20. <CFOUTPUT>
  21. <UL>
  22.     <LI>year: #DatePart("yyyy", "#todayDate#")#
  23.     <LI>quarter: #DatePart("q", "#todayDate#")#
  24.     <LI>month: #DatePart("m", "#todayDate#")#
  25.     <LI>day of year: #DatePart("y", "#todayDate#")#
  26.     <LI>day: #DatePart("d", "#todayDate#")#
  27.     <LI>weekday: #DatePart("w", "#todayDate#")#
  28.     <LI>week: #DatePart("ww", "#todayDate#")#
  29.     <LI>hour: #DatePart("h", "#todayDate#")#
  30.     <LI>minute: #DatePart("n", "#todayDate#")#
  31.     <LI>second: #DatePart("s", "#todayDate#")#
  32. </UL>    
  33.     
  34. </CFOUTPUT>    
  35. </BODY>
  36.  
  37. </HTML>       
  38.