시점 및 기간 비교
시점이 기간의 이전이나 이후인지 또는 그 중간에 있는지 확인합니다. 기간에 시점이 포함되는지 또는 기간이 특정 시점에 시작 및 종료하는지를 확인합니다.
시점 및 기간 비교
- before
시점이 기간의 시작보다 빠르면 이 시점은 기간 이전입니다.
- after
시점이 기간의 종료와 동일한 인스턴트이거나 이보다 늦으면 이 시점은 기간 이후입니다.
- during
시점이 시작 시간과 동일한 인스턴트이거나 이보다 늦으며 종료 시간보다 이르면 이 시점은 기간 중에 있습니다.
시점은 기간의 시작 및 종료와 비교될 수 있습니다. 예: each purchase event is before the end of 'the trip'.
시점을 달력 기간과 비교할 수도 있습니다. 예:
the departure time of 'the flight' is during the calendar year 2012
the departure time of 'the flight' is after the calendar month February 2007
the departure time of 'the flight' is before today
다음 규칙에서 항공편 기간은 스케줄된 출발 날짜 및 도착 날짜로 정의됩니다.
when a purchase event occurs
definitions
set 'the flight' to a flight in the flights of 'the customer';
set 'the flight period' to the period between the scheduled departure time of 'the flight' and the scheduled arrival time of 'the flight';
if this purchase event is during 'the flight period'
then print "purchase on board";
시점과 비교되거나 시점을 포함하는 비교
- before
- after
- includes
예: the period of two hours after the start of 'the business trip' includes 'the purchase event'
- starts at
- ends at
예: 'the exceptional promotion period' ends at 'the purchase event'
운송 규칙은 기간을 시점과 비교함으로써 표현될 수 있습니다. 이 규칙은 includes 연산자를 사용합니다.
when a flight arrival event occurs
if there is at least one flight in the flights of 'the customer'
where the period of 1 hour after this flight arrival event includes the scheduled departure time of this flight,
then
print "less than 1 hour of transit time.";
기간 내의 시점
시점은 시점 이전이나 이후의 지속 기간에 의해 정의되는 기간 내에 있을 수 있습니다.
예: 'the purchase event' is within 2 hours after the start of 'the business trip'. 이 표현식은 'the purchase event' is during the period of 2 hours after the start of 'the business trip'과 동등합니다.
다음 규칙은 현재 항공편의 도착 이후의 시간에 다른 항공편 출발이 있는지 여부를 확인합니다.
when a flight arrival event occurs
if there is at least one flight in the flights of 'the customer'
where the scheduled departure time of this flight is within 1 hour after the scheduled arrival time of this flight,
then print "less than 1 hour of transit time.";
시작 및 종료 시간과 비교되는 시점
언어에는 시점이 시간 및 종료 시간 사이에 있는지 여부를 테스트하기 위한 여러 연산자가 포함됩니다. 비교에는 시작 및 종료 시간이 포함되거나 제외될 수 있습니다.
다음 연산자를 사용하여 시작 및 종료 시간 간의 시점을 확인할 수 있습니다.
- before 또는 after
예: 'the purchase event' is after the start of 'the business trip' and before the arrival time of 'the flight'.
- on or before 또는 on or after
예: 'the purchase event' is on or after the start of 'the business trip' and before the arrival time of 'the flight'