You've also got the option of the dateCompare function.

Cheers


Will Swain
Hot Horse Ltd - Web Design and Development

0845 458 2536

www.hothorse.com 

The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s). If you
are not the intended recipient, you are not authorised and must not
disclose, copy, distribute or retain this message or any part of it.

The contents of this message may contain personal views which are not the
views of Hot Horse Ltd, unless specifically stated.

Hot Horse Ltd Company Number 3877066 Registered Office The Stables,
Connaught Road, Seaford, East Sussex. BN25 2PT.

Should you experience any problems with opening and reading emails and
attachments or you are not the intended recipient, please contact
[EMAIL PROTECTED]

-----Original Message-----
From: Bob Imperial [mailto:[EMAIL PROTECTED] 
Sent: 10 June 2008 16:30
To: CF-Newbie
Subject: RE: checking to see if date has passed

Ok that's just way too simple :) Thanks Greg! Sometimes my brain makes
things more complicated than they need to be.

Bob

-----Original Message-----
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2008 11:19 AM
To: CF-Newbie
Subject: Re: checking to see if date has passed

Try this

<cfset foodate = createdate(2008, 4, 1) />

<cfif foodate lt now()>
        This is in the past
<cfelse>
        This is not in the past
</cfif>


On Tue, Jun 10, 2008 at 10:09 AM, Imperial, Robert
<[EMAIL PROTECTED]> wrote:
> Hi folks,
>
>
>
> I realize this is probably elementary for most of you but I'm not 
> seeing the solution I need for this. I have 2 dates being passed from 
> a form in this format 07/10/2008 and I am trying to check to see if 
> these dates have passed today's date in Coldfusion. Not having much 
> success with it at this point and any help would be greatly 
> appreciated. I have tried the following by stripping out everything 
> that's not numeric, but of course that won't work, but it was a nice 
> exercise in using  replace J TIA
>
>
>
> <cfset ThisDate = now()>
>
> <cfset TheDate = DateFormat(ThisDate, 'mm/dd/yyyy') />
>
> <cfset justThisNumber = rereplace(TheDate,"[^[:digit:]]*","","all")>
>
>
>
> <cfset justThatNumber =
> rereplace(form.fromDate,"[^[:digit:]]*","","all")>
>
>
>
> <cfset justTheOtherNumber =
> rereplace(form.toDate,"[^[:digit:]]*","","all")>
>
>
>
> <cfif justThatNumber LT justThisNumber OR justTheOtherNumber LT
> justThisNumber>
>
> <script>
>
>            alert("The from or to date you entered has already passed, 
> please enter a new date.");
>
>            history.back();
>
> </script>
>
>  <cfelse>
>
>
>
> Bob
>
>
>
>





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3743
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to