so either the error is when the dates are being inserted to the array, or when the array is converted to a list. you tried looping through the array, outputting it's values?
Mark Smyth <[EMAIL PROTECTED]>
23/04/2004 16:37
|
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> cc: Subject: RE: [ cf-dev ] Dateformat wierdness |
when i output #dateformat(i,"mm yyyy")#
within the loop the years are all changed to 2004....
-----Original Message-----
From: Mark Smyth [mailto:[EMAIL PROTECTED]
Sent: 23 April 2004 15:29
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] Dateformat wierdness
sorry, my typo. was playing around with it to see if it was date mask specific
the datemask i'm actually using is
mmmm yyyy
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 23 April 2004 15:27
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] Dateformat wierdness
Does dateformat(i,"mm yyyy")
really give you:
April 2004,July 2004,October 2004,January 2004
? I'd expect 04 2004, 07 2004, 10 2004, etc. You said outputting #i# was correct, did you try outputting #dateformat(i,"mm yyyy")#?
Mark Smyth <[EMAIL PROTECTED]>
23/04/2004 16:20 | To: [EMAIL PROTECTED] cc: Subject: [ cf-dev ] Dateformat wierdness |
Hi, this is weird
I have an array with the following dates
Apr-03
Jul-03
Oct-03
Jan-04
I put them into a list using arraytolist (cause i'm appending it to a CSV file and its easier).
<cfset dList=#arraytolist(datearr)#>
Which gives me:
Apr-03,Jul-03,Oct-03,Jan-04
I then create a new list and loop over #dList# to create a list with formatted dates
<cfset dList2="">
<cfloop index="i" list="#dlist#">
<cfset dList2 = listappend(dList2, dateformat(i,"mm yyyy"))>
</cfloop>
But if I then output dList2 I get
April 2004,July 2004,October 2004,January 2004
All the years have been change to 2004! But if I output #i# in the loop it leaves the years unaltered, it looks like listappend is throwing a spanner in the works
Anyone see anything i'm doing wrong or is it a bug?
Thanks
Mark