Converting Time Slots and Periods to Strings

Converting time slots to strings

The following functions enable conversion between calendar slots and free format strings using the conversion specifiers discussed in the previous section. Their syntax is

The result of the function TimeSlotToString is a description of the specified time-slot according to format-string. The result of StringToTimeSlot is the time slot in calendar in which the string moment-string, specified according to format-string, is contained.

Converting timetable periods to strings

With the function PeriodToString you can obtain a description of a period in a timetable that consists of multiple calendar slots.

The result of the function is a description of the time span covered by a period in a horizon according to the specified timetable and format-string. The format-string argument can use period-specific conversion specifiers to generate a description referring to both the beginning and end of the period.

Obtaining the current time

The functions CurrentToString and CurrentToTimeSlot can be used to obtain the current time. Their syntax is

The function CurrentToString will return the current time according to the specified format string. If you do not use the %TZ specifier in the format string of the CurrentToString function, AIMMS assumes daylight saving time by default. You can change this default behavior by setting the global option current_time_in_LocalDST to 0. The function CurrentToTimeSlot returns the time slot in calendar containing the current moment.