question

left.tsig avatar image
0 Likes"
left.tsig asked Felix Möhlmann answered

Compare Datetimes

Hello,

I am working with FlexSim and need to perform a comparison in a Decide module. Specifically, I have a date stored in a global table, and I write this date into a token. I want to check if this date is equal to the previous date in the FlexSim model.

Does anyone have an idea on how to implement this check? Any guidance or suggestions would be greatly appreciated!

FlexSim 24.2.0
datetimecompare
· 1
5 |100000

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

Felix Möhlmann avatar image Felix Möhlmann commented ·
What is the "previous date"? The label value of the previous token that went through the activity?
0 Likes 0 ·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You can get the day by truncating the value of the totalDays DateTime property. Then just compare the current day minus 1 to the day of the label value.

check-previous-day.fsm


5 |100000

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

left.tsig avatar image
0 Likes"
left.tsig answered

I have a date stored in a global table, and I write this date into a token. I want to check whether this date matches the previous date ofthe FlexSim model.

For example, if the model is currently running on 27/01/2025, I want to retrieve 26/01/2025 and compare it with the date stored in the token from the global table.

5 |100000

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