Hi, I have the following code:
<CFSET tommorow = DateAdd(d,1,Now())>
<CFIF #bookdate# EQ #tommorow# AND Time() LT "20:00">
Error!
</CFIF>
With this code what I am trying to do is set the variable tommorow to tommorows system date by using the DateAdd function by adding a day d, one day with the 1 to the system date Now().
Then I carry out a CFIF statement which compares a date entered by a user within an input box in WML and if this is equal to the variable tommorow and the system Time() is less than 20:00 hours then the user cannot make a booking.
So if a user is booking for a date tommorow but the time of booking is before 20:00 hours they cannot.
I have a feeling that the code above is not right, I am not sure about the DateAdd function?. I have implemented the code but does not work.
Any help appreciated.
<CFSET tommorow = DateAdd(d,1,Now())>
<CFIF #bookdate# EQ #tommorow# AND Time() LT "20:00">
Error!
</CFIF>
With this code what I am trying to do is set the variable tommorow to tommorows system date by using the DateAdd function by adding a day d, one day with the 1 to the system date Now().
Then I carry out a CFIF statement which compares a date entered by a user within an input box in WML and if this is equal to the variable tommorow and the system Time() is less than 20:00 hours then the user cannot make a booking.
So if a user is booking for a date tommorow but the time of booking is before 20:00 hours they cannot.
I have a feeling that the code above is not right, I am not sure about the DateAdd function?. I have implemented the code but does not work.
Any help appreciated.