After taking tidbits from all the helpful answers and comments, I have found a satisfactory way to set the start and stop time programmatically in my model. The below code is what I am using:
//Set model start time
DateTime startTime = DateTime("6/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
function_s(getmodelunit(START_TIME_NODE), "setDateTime", startTime);
//Set model stop time based on calculation to determine model duration
DateTime stopTime = DateTime("6/1/2023 08:05:00","%m/%d/%Y %H:%M:%S");
int s = stopTime.totalSeconds - startTime.totalSeconds;
stoptime(s);
The reason I am using the code like this, is because I can quickly see the DateTime format and know intuitively if the start and stop time is correct without having to do math in my head. The above simple code is then expanded to my actual model, where a user can select which month they want to run the model (12 values ranging from April 2023 to March 2024) from a comboBox drop down in a GUI. Then that drop down menu will change a value in a Global Table and call a user command which houses the following code:
/**Custom Code*/
//delcare variables
DateTime startTime;
DateTime stopTime;
int s;
//set the start and stop time variables, depending on value from table.
//The value in the table changes via the UI comboBox drop down menu.
switch(Table(TBL_MODEL_MODES)[MODE_MONTH_OPTION][1])
{
case 1:
startTime = DateTime("1/1/2024 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("1/31/2024 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 2:
startTime = DateTime("2/1/2024 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("2/29/2024 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 3:
startTime = DateTime("3/1/2024 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("3/29/2024 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 4:
startTime = DateTime("4/3/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("4/28/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 5:
startTime = DateTime("5/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("5/31/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 6:
startTime = DateTime("6/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("6/30/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 7:
startTime = DateTime("7/3/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("7/31/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 8:
startTime = DateTime("8/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("8/31/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 9:
startTime = DateTime("9/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("9/30/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 10:
startTime = DateTime("10/2/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("10/31/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 11:
startTime = DateTime("11/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("11/30/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
case 12:
startTime = DateTime("12/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("12/31/2023 17:00:00","%m/%d/%Y %H:%M:%S");
break;
default:
startTime = DateTime("4/1/2023 07:00:00","%m/%d/%Y %H:%M:%S");
stopTime = DateTime("4/30/2023 17:00:00","%m/%d/%Y %H:%M:%S");
}
//set the start time of the model
function_s(getmodelunit(START_TIME_NODE), "setDateTime", startTime);
//calculate the duration, in seconds, that the model should run
s = stopTime.totalSeconds - startTime.totalSeconds;
//set the stop time of the model
stoptime(s);