CFIF between certain hours
Hi
I would like to use cfif time is between 12:00:00 and 04:00:00
my date and time is saved in variable datedate1
<cfset datedate1=#DateFormat(newTime,"yyyy-mm-dd hh:mm:ss")#>
any help would be appreciated
Thanks!
Hi
I would like to use cfif time is between 12:00:00 and 04:00:00
my date and time is saved in variable datedate1
<cfset datedate1=#DateFormat(newTime,"yyyy-mm-dd hh:mm:ss")#>
any help would be appreciated
Thanks!
JulesSon wrote:
sorry need it to be between 12:00 am (midnight) and 4:00 am
Thanks!
As suggested by Dan, use the results of the datePart function in your comparison. DateFormat and TimeFormat return strings. DatePart returns an integer. Comparing numbers (not strings) will produce the most consistent and accurate results.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.