Greetings community I have a problem when importing an Excel I have a date and time and I want to convert those Excel input data to seconds in my global table but it gives me very high values which should not be, what could be wrong in my code? import source
The times must go to seconds regardless of when the simulation starts running and be able to change the start date and time of the simulation.
code of import
int onreset = param(1); //1 if this code is being called on Reset of the model, 0 otherwise
Table table = Table(Model.find("llegadas (Global Table"));
DateTime ModelStart = Model.dateTime; //get model start time as a number
for (int i = 1; i <= table.numRows; i++){
string StartTime = table[i][1];
DateTime date = DateTime(StartTime, "%m/%d/%Y "); //get string as a number
table[i][1] = date - ModelStart;//calculate the difference between start time and arrival time in number of seconds
}