Time period operators
Use time period operators to define, calculate, and compare time periods.
A time period is an interval of time between two points, which is defined by a start time and an end time. A time period contains its start time, but it does not contain its end time. A period has a duration that is equal to the distance between the start and end times of the period.
You can specify a time period by a start time and a duration, or an end time and a duration.
For more information about time periods, see Reasoning over time and events.
| Operator | Example | Comments |
|---|---|---|
the period between <a date> and <a date> |
the period between the new scheduled arrival date of the first flight delayed event and now |
|
the period of <a calendar duration> before <a date> |
the period of 7 days before 'the purchase event' |
Returns a time period. The time period does not include the specified time point. |
the period of <a calendar duration> after <a date> |
the period of 1 month after 'the purchase event' |
Returns a time period. The time period does not include the specified time point. |
the period of <a calendar duration> ending at <a date> |
the period of 7 days ending at 'the purchase event' |
Returns a time period. The time period includes the specified time point. |
the period of <a calendar duration> starting at <a date> |
the period of 7 days starting at 'the purchase event' |
Returns a time period. The time period includes the specified time point. |
the period of <a calendar duration> before <a time period> |
the period of 7 days before 'the trip period' |
|
the period of <a calendar duration> after <a time period> |
the period of 1 month after 'the trip period' |
|
the period of <an absolute duration> before <a date> |
the period of the duration of 'the exceptional promotion' before 'the purchase event' |
Returns a time period. The time period does not include the specified time point. |
the period of <an absolute duration> after <a date> |
the period of the duration of 'the exceptional promotion' after 'the purchase event' |
Returns a time period. The time period does not include the specified time point. |
the period of <an absolute duration> ending at <a date> |
the period of the duration of 'the exceptional promotion' ending at 'the purchase event' |
Returns a time period. The time period includes the specified time point. |
the period of <an absolute duration> starting at <a date> |
the period of the duration of 'the exceptional promotion' starting at 'the purchase event' |
Returns a time period. The time period includes the specified time point. |
the period of <an absolute duration> before <a time period> |
the period of the duration of 'the exceptional promotion' before 'the flight period' |
|
the period of <an absolute duration> after <a time period> |
the period of the duration of 'the exceptional promotion' after 'the flight period' |
|
the last period of <a calendar duration> |
the last period of 1 month |
This operation is based on the parameter now. However the value of now is not included in the time period. |
the next period of <a calendar duration> |
the next period of 7 days |
This operation is based on the parameter now. However the value of now is not included in the time period. |
| Operator | Example | Comment |
|---|---|---|
<a calendar duration> before <a time period> |
3 hours before 'the flight period' |
Returns a new time point. |
<a calendar duration> after <a time period> |
2 months 3 days after 'the flight period' |
Returns a new time point. |
<an absolute duration> before <a time period> |
the duration of 'the wait time' before 'the flight period' |
|
<an absolute duration> after <a time period> |
the duration of 'the trip' after 'the flight period' |
| Operator | Example | Comment |
|---|---|---|
<a time period> is during the same time as <a time period> |
'the trip period' is during the same time as 'the school holiday period' |
Defines time intervals that start at the same instant of time and end at the same instant of time. |
<a time period> overlaps with <a time period> |
'the flight period' overlaps with 'the trip period' |
|
<a time period> is before <a time period> |
'the flight period' is before 'the trip period' |
|
<a time period> is after <a time period> |
'the trip period' is after' the flight period' |
|
<a time period> is after <a date> |
'the trip period' is after 3/7/2013 5:32:38 PM |
|
<a time period> is before <a date> |
'the trip period' is before 3/11/2013 5:32:38 PM |
|
<a time period> includes <a date> |
'the trip period' includes the time of 'the purchase event' |
|
<a time period> starts at <a date> |
'the trip period' starts at 3/7/2013 6:00:00 PM |
|
<a time period> ends at <a date> |
'the trip period' ends at 3/11/2013 6:00:00 PM |
| Operator | Example | Comment |
|---|---|---|
<a time period> is longer than <a time period> |
'this trip period' is longer than 'this flight period'
|
|
<a time period> is longer than or equal to <a time period> |
'this trip period' is longer than or equal to 'this flight period'
|
|
<a time period> is shorter than <a time period> |
'this trip period' is shorter than 'this flight period'
|
|
<a time period> is shorter than or equal to <a time period> |
'this trip period' is shorter than or equal to 'this flight period'
|
|
<a time period> is longer than <a calendar duration> |
'this trip period' is longer than 6 hours
then...
|
|
<a time period> is longer than or equal to <a calendar duration> |
'this trip period' is longer than or equal to 2 hours 30 minutes
|
|
<a time period> is shorter than <a calendar duration> |
'this trip period' is shorter than 2 hours
|
|
<a time period> is shorter than or equal to <a calendar duration> |
'this trip period' is shorter than or equal to 2 hours
|
| Operator | Example | Comment |
|---|---|---|
the calendar year <number> |
the calendar year 2013 |
|
the calendar month <month name> <year number> |
the calendar month April 2013 |
|
the calendar day <month name> <day of month number>, <year number> |
the calendar day April 14, 2013 |
| Operator | Example | Comment |
|---|---|---|
the duration of <a time period> |
the duration of 'the trip period' |
|
the start of <a time period> |
the start of 'the trip period' |
Defines the start point of a time period. |
the end of <a time period> |
the end of 'the flight period' |
Defines the end point of a time period. |
| Operator | Example | Comment |
|---|---|---|
<time point collection> before <a time period> |
all flight delay events before 'the holiday' |
|
<time point collection> after <a time period> |
all flight delay events after 'the holiday' |
|
<time point collection> during <a time period> |
all flight delay events during the period of 2 weeks after the start of 'the holiday' |
Example: the period between
The following rule checks if there are more than 10 purchases during the flight. The rule defines the flight period as the period between the departure and the arrival of the flight.
definitions
set 'the flight period' to the period between the departure time of 'the flight' and the 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 during this flight.";