question

Nil Ns avatar image
0 Likes"
Nil Ns asked Felix Möhlmann answered

Some problems when export dates

Hello All,

I am trying to export some data to Excel, but I have a problem with the dates.

I use Model.dateTime.toString("%x") to create the date column in FlexSim:

1676973742397.png

The date is in format DD/MM/YYYY, the same that the model and the format that I want.

But that's the column in excel, after the export:

1676973858443.png

As you can see Excel change the format of the first date to MM/DD/YYYY.

When I create a filter, this is what appears:

1676973970677.png

It seems that Excel has the date saved as March 2 (and not February 3). The other dates are simply interpreted as a string.


Any idea?

Thanks for the support!

FlexSim 22.2.3
excel exportdatetime
1676973742397.png (1.8 KiB)
1676973858443.png (2.4 KiB)
1676973970677.png (3.2 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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered

You could try to use "convert()" to transform the FlexSim datetime into the Excel time format and then export those values.

1676977691509.png

I don't know if the export would overwrite the column format setting in Excel. But if it does, switching it back to date formatting should result in the correct date.


1676977691509.png (67.6 KiB)
· 2
5 |100000

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

Nil Ns avatar image Nil Ns commented ·

Hey Felix,

It works, thanks.

I don't know why but at the same point Excel stop detecting that it is a date and shows the number.1676978645057.png

Even so, it is solved if i change the format of the column to date

Thank you so much.

0 Likes 0 ·
1676978645057.png (2.0 KiB)
Felix Möhlmann avatar image Felix Möhlmann Nil Ns commented ·
Nice to know that I could help. In that case I will change the comment into an answer. It would be nice if you could accept it to let others know the question is solved.
0 Likes 0 ·