I have a long list of dates that are in formats:YYYY-MM-DD or DD/MM/YYYY. I use CDate() for conversion. However, if system default date is YYYY-MM-DD, I get wrong dates converted from DD/MM/YYYY where Day and Month gets mixed up if Day is less than 13. For example:
date_string = "12/02/2016"
date_string = Cdate(date_string)
Debug.Print date_string #prints "2016-12-02"
I understand that CDate() largely depends on system and string format. I was wondering if there's a good way to capture day and month and do correct conversion? The list always includes only two mentioned date formats.
SplitandDateSerialto rebuild the dates in an unambiguous fashion.