> Folks:
> I am trying to obtain a date from the ordinal produced by the function
> DayOfYear. In other words, does anyone know how to "reverse engineer" the
> ordinal into a usable date? I would assume I'd need to pass the ordinal
> and the year to some function to obtain a usable date. I can't seem to
> find a function that will accomplish this! Any ideas?
I'm not sure about an existing function ... but the only thing that leaps to
my mind is this:
<cfset indexdate = CreateDate(2002,1,1)>
<cfset mydayofmonth = 200>
<cfloop condition="DaysInMonth(indexdate) lt mydayofmonth">
<cfset mydayofmonth = mydayofmonth - daysinmonth(indexdate)>
<cfset indexdate = dateadd("mm",1,indexdate)>
</cfloop>
<cfset MyDate = DateAdd("dd",1,mydayofmonth)>
This is somewhat crude, but it should work, and you could do this in
CFScript and make it a function and then reuse it, which is probably more
useful.
Isaac Dealey
Certified Advanced ColdFusion 5 Developer
www.turnkey.to
954-776-0046
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists