Function TimeSlotCharacteristic(Timeslot, Characteristic, Timezone, IgnoreDST)

TimeSlotCharacteristic

The function TimeSlotCharacteristic obtains a numeric value which characterizes the time slot, in terms of its day of the week, its day in the year, etc.

TimeSlotCharacteristic(
     Timeslot,       ! (input) an element (time-slot) in a calendar
     Characteristic, ! (input) an element in TimeslotCharacteristics
     Timezone,       ! (optional) an element in AllTimeZones, default Local.
     IgnoreDST       ! (optional) 0-1 expression, default 0.
     )

Arguments

Timeslot

A element refering to a time-slot in a calendar.

Characteristic

An element in the predefined set TimeSlotCharacteristics, each element in this set refers to a specific value that can be retrieved for a time slot.

Timezone

A time zone from the predefined set AllTimeZones.

IgnoreDST

A 0-1 expression indicating whether or not to ignore daylight savings time.

Return Value

The function TimeSlotCharacteristic returns a numerical value for the requested time slot characteristic.

Example

Given the declarations:

Calendar cal_days {
        Index: i_day;
        Unit: day;
        BeginDate: "2024-01-01";
        EndDate: "2024-01-14";
        TimeslotFormat: "%c%y-%m-%d";
}
ElementParameter _ep_firstDay {
        Range: cal_days;
}
Parameter _p_dayNoInWeek;

The code:

_ep_firstDay := first( cal_days );
_p_dayNoInWeek := TimeslotCharacteristic(
        Timeslot       :  _ep_firstDay,
        Characteristic :  'weekday' );
display _p_dayNoInWeek ;

Results in:

_p_dayNoInWeek := 1 ;

Indicating that the first day of the calendar is a Monday.

See also

The function TimeSlotCharacteristic is discussed in full detail in Creating Timetables of the Language Reference.