If ICU is enable in salesforce org then DateTime.parse() is not working properly.
System.debug(DateTime.parse('11/23/2020, 11:23 AM')); // error with ICU System.debug(DateTime.parse('11/23/2020 11:23 AM')); //error without ICU
as different time zone can have different dateTime format. and DateTime.parse() is not sapporting any other format. is there any way which can help me to change DateTime to String and again string to DateTime.
We had this same problem and what I found was that the documentation has been updated to show that supported formats are 1/28/2008, 4:30 PM. Notice the comma between the date and time.
So we updated our Apex code to use a comma between, turned on the ICU Locale Release Update and moved on....but now we have tests failing with the same error but WITH ICU turned on. :/