Read excel date column with two possible format

Hello, Community

I need to read a column from an excel file, this column could use two format (dd/MM/yyyy, MM/dd/yyyy)

I am using the next expression but it does not work

This is the error message

Can someone help me find a solution?

Test to change your format strings to:

{"dd/MM/yyyy HH:mm:ss", "MM/dd/yyyy HH:mm:ss"}

HH is for 24H and hh is for 12H.

Also be aware that some dates could be converted wrongly because there’s no way to differentiate which number is the date and which number is the month unless n>12. E.g. 01/02/2023 could be interpreted as either 01 February or 02 January.

1 Like

Thank you.

It worked nicelly. I just made some adjust for my case.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.