Im creating a xmas opening script using vbscript to bolt onto our VoIP system call routing script. It all works perfectly. I have posted a section of the code below:
Concentrate on the section
Would this be the correct way to represent 08:00 > 17:30 ?? I know the 08:00 > 17:00 works fine, but I added the xminute as our actual closing time is 17:30.
Will this work or will I have to represent this 30 minutes another way?
Code:
Function CheckDateTime(current)
current = CDate(current)
'
' Prepare useful variables...
Dim xday, xmonth, xhour, xminute
xhour = Hour(current)
CheckDateTime = 0
'Normal working day
If (xhour >=8 and xhour <17 and xminute<30) Then
CheckDateTime = 1
End If
'Christmas period
If (current >= CDate("24/12/2009 12:00PM") and current <= CDate("04/01/2010 08:00AM")) Then
CheckDateTime = 2
'25th December
If (current >= CDate("25/12/2009 00:01AM") and current <= CDate("25/12/2009 23:59PM")) Then
CheckDateTime = 3
End If
Concentrate on the section
Code:
'Normal working day
If (xhour >=8 and xhour <17 and xminute<30) Then
CheckDateTime = 1
End If
Would this be the correct way to represent 08:00 > 17:30 ?? I know the 08:00 > 17:00 works fine, but I added the xminute as our actual closing time is 17:30.
Will this work or will I have to represent this 30 minutes another way?