시간 정보 인쇄

메시지를 생성할 때 시점, 기간, 달력 지속 기간 및 절대 지속 시간을 인쇄할 수 있습니다.

시점, 기간, 달력 지속 기간 및 절대 지속 기간의 문자열 표시는 ISO 8601 표준에 정의된 확장 양식을 기반으로 합니다.

달력 지속 기간에는 년, 월, 일, 시, 분 및 초가 포함될 수 있습니다. 절대 지속 기간에는 일반 단위 시, 분 및 초가 포함될 수 있습니다. 윤초(leap second)가 포함되거나 포함되지 않을 수 있으므로 일은 일반 단위가 아닙니다.

예제

다음 규칙은 두 개의 시점, 기간, 달력 지속 기간 및 절대 지속 기간이 포함된 메시지를 인쇄합니다.

when a project launch delay event occurs
definitions
    set 'project start time' to the delay of this project launch delay event after the planned start time of 'the project' ;
    set 'project end time' to the project duration of 'the project' after 'project start time' ;
then
    print "Project start (Time Point): " + 'project start time' ;
    print "Project end (Time Point): " + 'project end time' ;
    print "Project period (Time period): " + the period between 'project start time' and 'project end time' ;
    print "Project duration (Calendar Duration): " + the project duration of 'the project' ;
    print "Project duration (Absolute Duration): " + the duration between 'project start time' and 'project end time' ;

이 규칙은 다음 문장을 인쇄할 수 있습니다.

Project start (Time Point): 2014-02-21T00:00+01:00[Europe/Monaco]
Project end (Time Point): 2015-05-31T00:00+02:00[Europe/Monaco]
Project period (Time period):
2014-02-21T00:00+01:00[Europe/Monaco]/2015-05-31T00:00+02:00[Europe/Monaco]
Project duration (Calendar Duration): P1Y3M8D
Project duration (Absolute Duration): PT11159H

여기서 T는 시간 요소의 시작을 표시합니다. [Europe/Monaco]는 솔루션 시간대입니다.

코드의 마지막 두 행에서 P는 지속 기간을, Y는 년을, M은 월을, D는 일을, 그리고 H는 시를 표시합니다.