DatesInPeriod

Description

Given a periodic slot and a date, this function returns an ordered list of dates representing the beginning time of each interval which begins in the specific period containing the input (reference) date.

Type

LIST {DATETIME}

Arguments

Type

Meaning

1

SLOT

a periodic slot

2

DATETIME

a reference date

Evaluation

Every periodic slot has a period associated with it and this period is divided into intervals. Intervals are either regular (e.g., Days) or irregular (e.g., the beginning of one interval might be 8:00 July 3 of each period). One can map a period (divided into intervals) onto a time line, leading to several specific periods (divided into specific intervals). For example, the period "Year" maps onto specific periods corresponding to each year, such as the specific period which is the year 2003.

Providing a reference date serves to indicate a specific period, and this function returns the dates corresponding to the beginning of each time interval which begins in that specific period.

Comments

When the beginning of an interval occurs exactly at a period boundary (e.g., an interval beginning at "0:00 January 1" with an Yearly period), then we consider that interval to begin in the period occurring after midnight, not the one before.

Note that not all time intervals (rows) defined in a Periodic Slot will correspond to intervals in a specific period. For example, for a period of Month, an interval might be defined which begins at "12:00 Day 30". This interval does not exist in all months and so for example if the reference date is 12:00 February 1, 2003, then the list returned by this function would not include the date 12:00 February 30, 2003.

 
DatesInPeriod(TableA.AvePrecipitation, @"January 1, 2001")
 
If TableA.AvePrecipitation has 3 rows for 0:00 January 1, 6:00 June 15, and 24:00 September 1, Then the above function returns:
{ @"24:00 December 31, 2000", @"6:00 June 15, 2001", @"24:00 September 1, 2001"}