Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
sattman #1
change month number to name
I have a setting for a calendar that defaults the calender to the current month
<cfset cal_month=dateformat(now(), "m")>
This can be changed by the user to any month
When the month is displayed I want to show the name of the month instead of
the number, i.e. if cal_month is 1 I want it to display January.
I tried #dateformat(month(cal_month), "mmmm")# but it came back as december
everytime
I placed a #cal_month# next to it to make sure the month wasn't defaulting
somehow to 12 but it was still set as 1
thanks
sattman Guest
-
Change the first number
Hi All, I have a list of ID numbers that are populated in from a query into a cfselect. The numbers start a 1, but 1 is a fixed field that will... -
Getting the month by Number
Hi Folks, I'm trying to create an archive system, and want to be able to display articles according to the month. The system I have setup at the... -
Current month change
Hello, Total n00b here who needs help. I have a list of weblog (blog) entries in a database which are being retrieved by index.php with a string... -
Can I change view from month to week in calendar control ?????
I want to make a week view and day view just like month view calendar control in .NET. if any one knows how to do that or any one has the source... -
Can I display a month from a number in a csv file?
Greetings from a second day newbie to php. I think I have figured out a way to explode a field in a csv file (like 11-08-03) and implode it as... -
Dan Bracuk #2
Re: change month number to name
That would be the MonthAsString function.
Dan Bracuk Guest
-
mxstu #3
Re: change month number to name
sattman,
Just for future reference. You don't need to use the month() function on
#cal_month# because you have already set it to a month number in this statement.
<cfset cal_month=dateformat(now(), "m")>
Dateformat() requires a valid date object (eg. date in format mm/dd/yyyy).
Here you are passing in a month number which is why it is returning the wrong
results.
#dateformat(month(cal_month), "mmmm")#
That said, use #MonthAsString(monthNumber)# instead.
mxstu Guest



Reply With Quote

