hello
i have the following condition inside an if but something is wrong because i get different output from what i expect
i'm comparing a database table record fields with a user input datathe
the database table record fields representing a busy slot are saved into variables as follows:
$UnSlotDay: the day name
$UnSlotStartTime: busy slot start time
$UnSlotEndTime: busy slot end time
the user input for a new slot is:
$Day: the day name
$EndTime: new slot end time
$StartTime: new slot start time
if (($Day == $UnSlotDay) && (($EndTime<=$UnSlotStartTime) || ($StartTime>=$UnSlotEndTime)))
echo "OK";
else
echo "Not OK";
if the busy slot is on Monday from 09:00:00 to 11:00:00, and the the new slot is also on Monday from 11:00 to 12:00
I get the message "Not OK".
Is it because the user input in hh:mm format and the busy slot is in hh:mm:ss ???
pls help me