ty!
i dont need or expect to do it in 1 line but doing 40 switches is the very
long way im sure
> Are you wanting to do it in one line? I think you'd need to do multiple
> regexs anyway.
>
> You could just use the list functions (code untested):
>
> <cfif Len(ListGetAt(datevar,1," ")) eq 1>
> <!--- add "0" in front --->
> <cfset datevar = ListSetAt(datevar,1,"0" & ListGetAt(datevar,1," ")),"
> ">
> </cfif>
> <cfif Len(ListGetAt(datevar,2," ")) eq 1>
> <!--- add "0" in front --->
> <cfset datevar = ListSetAt(datevar,2,"0" & ListGetAt(datevar,1," ")),"
> ">
> </cfif>
> <cfif Len(ListGetAt(datevar,3," ")) eq 2>
> <!--- check for y2k --->
> <cfif ListGetAt(datevar,3," ") GT 79>
> <!--- add "19" in front --->
> <cfset datevar = ListSetAt(datevar,3,"19" & ListGetAt(datevar,1,"
> "))," ">
> <cfelse>
> <!--- add "20" in front --->
> <cfset datevar = ListSetAt(datevar,3,"20" & ListGetAt(datevar,1,"
> "))," ">
> </cfif>
> </cfif>
>
> Best to wrap this in a custom tag or UDF.
>
> Alternatively you could use CF's datetime functions or multiple regexs.
>
> HTH
>
> -- tim
>
> www.toolmantim.com
>
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Re: regex ? Tom Smith
- Re: regex ? Tom Smith
- RE: regex ? Pascal Peters
- RE: regex ? cf
- Re: regex ? Tom Smith
- Re: regex ? cf
- Re: regex ? Tom Smith
- Re: regex ? cf
- Re: regex ? cf
- Re: regex ? Tim Lucas
- Re: regex ? cf
- Re: regex ? Charlie Griefer
- RE: regex ? Pascal Peters