question

SudheerReddy avatar image
0 Likes"
SudheerReddy asked SudheerReddy edited

Date and time from excel is reading as string how to convert it to time

Flexsim identifies below date and time for order generation as string how to convert below data as date and time.

And also is there a way to convert below time to simulation time using any query in flexsim.

1694198541484.png


FlexSim 23.2.0
time
1694198541484.png (4.1 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

To convert a string representation of a date and time you can use the DateTime constructor.

To get the simulation time you can subtract the model start time from that value and then convert that value to your model units. For example:

string timestamp = "03-04-2023 12:16";
DateTime dateTime = DateTime(timestamp, "%m-%d-%Y %H:%M");
DateTime modelTime =  dateTime - Model.startDateTime;
return modelTime.totalSeconds;
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.