Michael,
If you want to compare only the time part of the date variables then reduce the variables to minutes. create 2 variables for the minutes by: parseInteger(formatDateTime($Appointment/ApptTime, 'HH'))* 60+parseInteger(formatDateTime($Appointment/ApptTime, 'mm') With the statement above you'll get the hours from $Appointment/ApptTime, multiplied with 60 and add the minutes of $Appointment/ApptTime to get the minutes from the start of the date. Do the same thing for the other variable and then compare the two.
I think you can use the formatDateTime function to output the time part in a format that is suitable for textual comparison. Note: untested code ahead.
formatDateTime($Appointment/ApptTime, 'HH:mm') >=
formatDateTime($IteratorCalendarEvent/StartDate) and
formatDateTime($Appointment/ApptTime, 'HH:mm')
formatDateTime($IteratorCalendarEvent/EndDate)
The HH make sure that the hours are represented in 24 hour notation with two digits (see also our documentation and the table here ). mm does the same for minutes. So, the times in your example will look like "09:30" and "13:00". These can then be compared textually for the desired result.
Could you simply store your times in a datetime attribute that only ever addresses/edits the time portion of the variable? If so, you should just be able to directly compare your variables, as the date portion of the variable will remain at its default.
You can make use of the minutesBetween()
var1 = StartTime
var2 = EndTime
var3 = RandomDateVariable
x= round(minutesBetween(trimToDays(var1),var1)) gives the minutes between StartTime and the beginning of that day
y = round(minutesBetween(trimToDays(var2),var2)) gives the minutes between EndTime and the beginning of that day
z = round(minutesBetween(trimToDays(var3),var3))
now z should be between x and y to be true
I have rounded the bunch because float is depricated