기간 관련 작업

기간은 시작 시간 및 종료 시간으로 정의되는 시간의 간격입니다. 기간에는 지속 기간이 있으며, 이는 시작 및 종료 시간 간의 간격과 동일합니다. 기간에는 시작 시점은 포함되지만 종료 시점은 포함되지 않습니다.

시작 시간 및 종료 시간, 시작 시간 및 지속 기간, 또는 종료 시간 및 지속 기간으로 기간을 지정할 수 있습니다. 시점을 보다 큰 시간 스케일로 변환할 때도 기간을 가져옵니다. 이에 해당되는 경우, 기간은 시점 및 대상 단위로 지정됩니다.

기간은 다양한 방법으로 표현될 수 있습니다.

달력 기간

달력 기간에는 달력 년, 월, 일이 포함됩니다.
  • 년 기간은 calendar year 용어 및 년도로 지정됩니다(예: the calendar year 2011).
  • 월 기간은 월 이름 및 년도로 지정됩니다(예: the calendar month February 2014).
  • 일 기간은 표준 날짜 표기법을 사용하여 지정됩니다(예: the calendar day December 31, 2013.

    이 예에서 하루의 기간은 1999년 12월 31일 오전 0시 0분 0초에서 시작하며 2000년 1월 1일 오전 0시 0분 0초에 끝납니다.

다음 규칙은 2013년 12월 31일 중에 공항이 닫혔는지 여부를 확인합니다. 이 규칙은 2013년 12월 31일의 마지막에 평가됩니다.

if    there is at least one airport closed event
        where this airport closed event is during the calendar day December 31, 2013 ,
then    print "The airport was closed on the last day of the year 2013.";

시작 및 종료점이 있는 기간

시작 시점 및 종료 시점으로 기간을 지정할 수 있습니다. 예: the period between the start of 'the business trip' and the end of 'the business trip'.

다음 규칙은 운항 중에 10회를 초과하는 구매가 있는지 여부를 확인합니다. 규칙은 운항 기간을 항공편 출발 및 도착 간의 기간으로 정의합니다.

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    there are more than 10 purchase events
        where each purchase event is during 'the flight period',
then    print "More than 10 purchases during this flight.";

시작점 또는 종료점 및 지속 기간이 있는 기간

기간을 시작 또는 종료 시간 및 지속 기간으로 지정할 수 있습니다. 예: the period of 7 days before 'the purchase event'.

다음 연산자를 사용하여 지정된 시간에 시작하거나 종료하며 특정 지속 기간이 있는 기간을 정의할 수 있습니다.
  • before 및 after는 기간의 시작 및 종료 시간을 정의합니다. 이는 지정된 시점을 선행 또는 후행하며 이 시점을 포함하지 않는 기간을 참조하는 데 사용됩니다.

    예: the period of 3 months before May 2012.

  • the period of <calendar duration> before는 주어진 시간에 종료되는 주어진 지속 기간의 기간을 정의합니다.
  • the period of <calendar duration> after는 주어진 시간에 시작되는 주어진 지속 기간의 기간을 정의합니다. 예: the period of 4 hours after the 'the flight' arrived

다음 연산자를 사용하여 지정된 시간에 시작하거나 종료하며 특정 지속 기간이 있고 지정된 시점이 포함된 기간을 정의할 수 있습니다.

  • the period of <calendar duration> starting at <a date>는 주어진 시간에 시작되는 주어진 지속 기간의 기간을 정의합니다.
  • the period of <calendar duration> ending at <a date>는 주어진 시간에 종료되는 주어진 지속 기간의 기간을 정의합니다. 예를 들어, the period of 4 hours ending at 'the purchase event'입니다.

다음 규칙은 항공편 도착 이후 3시간 안에 구매 이벤트가 있었는지 여부를 확인합니다.

when a flight arrival event has occurred 1 day ago
if    there is at least one purchase event
        where this purchase event is during the period of 3 hours after this flight arrival event,
then    print "At least one purchase 3 hours after the arrival of the flight.";

기간은 다중 시간 단위에서 달력 지속 기간으로 지정될 수 있습니다. 예: the period of 2 months 2 weeks after the launch date of 'the product'. 제품이 "February 14th, 2013 9:00:00 AM"에 런치된 경우, 2달 및 2주의 기간은 "April 28th, 2013 9:00:00 AM"에 종료됩니다.

기간으로 변환된 시점

시점을 보다 큰 시간 스케일로 변환함으로써 기간을 가져올 수 있습니다. 예: the period of 7 days before the calendar day of 'the purchase event'. 이 예에서 the calendar day는 시점 'the purchase event'가 포함된 그레고리오 책력(Gregorian calendar)의 날짜를 참조합니다.