@SanderB wrote: This answer is actually wrong because ANYHDTDTM will assume MM-DD-YYYY first over DD-MM-YYYY. If you give it 12-01-2023 it will read it as the 1st of December, but it should the 12th of January.
This is not (entirely) correct. The ANY... informats will prefer DMY or MDY depending on the DATESTYLE system option (which has a default setting of LOCALE, which means the current locale setting also influences the date order).
... View more