- Function TimeSlotToString(Format, Calendar, Timeslot)
TimeSlotToString
The function TimeSlotToString
creates a string representation of a
specific time slot in a calendar.
TimeSlotToString(
Format, ! (input) a string expression
Calendar, ! (input) a calendar
Timeslot ! (input) an element (timeslot) in the calendar
)
Arguments
- Format
A string that holds the date and time format used in the returned string. Valid format strings are described in Format of Time Slots and Periods
- Calendar
An identifier of type calendar.
- Timeslot
A specific time-slot in the calendar.
Return Value
The function
TimeSlotToString
returns a string representation of the time slot.
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";
}
The code:
_sp_day1 := TimeslotToString(
Format : "%Aw|AllAbbrWeekDays| %Am|AllAbbrMonths| %d, %c%y",
Calendar : cal_days,
Timeslot : first(cal_days));
display _sp_day1 ;
Results in:
_sp_day1 := "Mon Jan 01, 2024" ;
See also
The functions MomentToString
, CurrentToTimeSlot
, StringToTimeSlot
.