Time Switch Module

This module is used to direct the caller to a different part of the script based on Date or Time of Day.

The screenshot above shows a time range to covering 9am till 5pm on Saturday and Sunday. The Date/Time to Check field is left blank so the current time when the script is executed will be used. When specifying the 'times on selected days' the start time must be earlier in the day then the stop time.

 

Paths Chosen

The path "True" is taken if the current time falls within the specified time range, otherwise the "False" path is taken.

 

Date/Time to Check

Most of the time this field will be left blank as usually the intention is to check what is the current time and if it falls within the specified time range.

If the module is used to check whether a date/time entered by caller or retrieved from the database falls within a certain range then the date to be checked should be specified in this text field.

The format in which the date is to be specified will vary according to your computers settings for preferred date/time format. If specifying date and time then usually one of the following formats will be OK (hours are specified in a 24 hour format) :

MM/DD, YYYY HH:NN
DD/MM, YYYY HH:NN
MM/DD/YYYY HH:NN
DD/MM/YYYY HH:NN
HH:NN

If the date is not specified then current date is used.

How can the caller enter date/time? Usually by just entering the require information in a series of Get Numbers modules and then having all the data entered specified in the Date/Time to Check, eg:

$RV[GetMonth]/$RV[GetDay], $RV[GetYearYYYY] $RV[GetHour24]:00

If date is retrieved from database you should ensure that the correct format is supplied.

If the date/time format supplied is invalid then the "False" path is taken.

 

Note

Evaluate Expression module can also be used to set up time-switching.