> Hi list,
> I want to convert the date-number-string e.g. "0804" (mmyy)
> in a date something
> like: 08/31/2004
>
> Is there a datefunction for this ?
This code takes a 4 digit MMYY string and converts it to a date object
for the last day of the month.
- Rick
<CFSET orig = "0804">
<CFSET orig_date = Left(orig,2) & "/1/" & Right(orig,2)>
<CFSET final_date = >
<CFOUTPUT>#final_date#</CFOUTPUT>
or
<CFSCRIPT>
function convertit(orig) {
orig_date = Left(orig,2) & "/1/" & Right(orig,2);
return DateAdd('d',DaysInMonth(orig_date)-1,orig_date);
}
</CFSCRIPT>
<CFOUTPUT>#convertit("0804")#</CFOUTPUT>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

