home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / dayofyear.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.3 KB  |  48 lines

  1. <!--- shows the value of the dayOfYear function --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. DayOfYear Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>DayOfYear Example</H3>
  15.  
  16. <CFIF IsDefined("form.year")>
  17. More information about your date:
  18. <CFSET yourDate = CreateDate(form.year,form.month,form.day)>
  19.  
  20. <CFOUTPUT>
  21. <P>Your date, #DateFormat(yourDate)#.
  22. <BR>It is #DayofWeekAsString(DayOfWeek(yourDate))#, day #DayOfWeek(yourDate)# in the week.
  23. <BR>This is day #Day(YourDate)# in the month of #MonthAsString(Month(yourDate))#, which has #DaysInMonth(yourDate)# days.
  24. <BR>We are in week #Week(yourDate)# of #Year(YourDate)# (day #DayofYear(yourDate)# of #DaysinYear(yourDate)#).  
  25. <BR><CFIF IsLeapYear(Year(yourDate))>This is a leap year<CFELSE>This is not a leap year</CFIF>
  26. </CFOUTPUT>
  27.  
  28. </CFIF>
  29.  
  30.  
  31. <CFFORM ACTION="dayofyear.cfm" METHOD="POST">
  32. <P>Please enter the year, month and day in integer format for 
  33. the date value you would like to view:
  34. <PRE>
  35. Year    <CFINPUT TYPE="Text" NAME="year" VALUE="1998" VALIDATE="integer" REQUIRED="Yes">
  36. Month    <CFINPUT TYPE="Text" NAME="month" VALUE="6" VALIDATE="integer" REQUIRED="Yes">
  37. Day    <CFINPUT TYPE="Text" NAME="day" VALUE="8" VALIDATE="integer" REQUIRED="Yes">
  38. </PRE>
  39. <P><INPUT TYPE="Submit" NAME=""> <INPUT TYPE="RESET">
  40.  
  41.  
  42. </CFFORM>
  43.  
  44.  
  45. </BODY>
  46.  
  47. </HTML>       
  48.