monthAsString
Description
Determines the name of the month that corresponds to month_number.
Categories
Related
History
ColdFusion
8: Added the locale parameter.
Syntax
MonthAsString(month_number [, locale])
Attributes
| Attribute | Description | Required | Default |
|---|---|---|---|
| locale | Locale to use instead of the locale of the page when processing the function | ||
| month_number | An integer in the range 1 – 12. |
Returns
A string;
the name of the specified month, in the current locale.
Example
<h3>MonthAsString Example</h3>
<cfif IsDefined("FORM.year")>
More information about your date:
<cfset yourDate = CreateDate(FORM.year, FORM.month, FORM.day)>
<cfoutput>
Your date, #DateFormat(yourDate)#.
<br>It is #DayofWeekAsString(DayOfWeek(yourDate))#, day
#DayOfWeek(yourDate)# in the week.
<br>This is day #Day(YourDate)# in the month of
#MonthAsString(Month(yourDate))#, which has
#DaysInMonth(yourDate)# days.
<br>We are in week #Week(yourDate)# of #Year(yourDate)#
(day #DayofYear(yourDate)# of #DaysinYear(yourDate)#). <br>
<cfif IsLeapYear(Year(yourDate))>This is a leap year
<cfelse>This is not a leap year
</cfif>
</cfoutput>
</cfif>