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

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