Comparing a period and a calendar duration
A time period can be longer or shorter than a calendar duration.
Use the following operators to compare a time period and a calendar
duration:
- is shorter than and is shorter than or equal to
- is longer than and is longer than or equal to
The following rule checks whether a flight is shorter than two hours.
definitions
set 'the flight period' to the period between the scheduled departure time of 'the flight'
and the scheduled arrival time of 'the flight';
if
'the flight period' is shorter than 2 hours
then
print "The flight is a short one";