Function CurrentToTimeSlot(Calendar)

CurrentToTimeSlot

The function CurrentToTimeSlot determines the time slot in a calendar that corresponds with the current time.

CurrentToTimeSlot(
     Calendar           ! (input) a calendar
     )

Arguments

Calendar

An identifier of type calendar.

Return Value

The function CurrentToTimeSlot returns the time slot in the calendar that contains the current moment.

Note

There is an option Current_Time_in_LocalDST that specifies whether this function takes into account the effects of daylight savings time.

Example

Given the following declarations:

Calendar cal_DaysLongGone {
        Index: i_dayGone;
        Unit: day;
        BeginDate: "2000-01-01";
        EndDate: "2000-12-31";
        TimeslotFormat: "%c%y-%m-%d";
}
Calendar cal_ForALongTime {
        Index: i_day;
        Unit: day;
        BeginDate: "2024-01-01";
        EndDate: "2064-12-31";
        TimeslotFormat: "%c%y-%m-%d";
}

The code:

ep_past := CurrentToTimeSlot( cal_DaysLongGone );
ep_curr := CurrentToTimeSlot( cal_ForALongTime );
display ep_past, ep_curr ;

Results in:

ep_past := '' ;
ep_curr := '2024-07-15' ;

when this example was created.

See also

The functions StringToTimeSlot, MomentToTimeSlot.