I am having a weird scenario where DateTime.TryParse(..) is returning different results with a custom culture (en-US) between two different laptops for a MM/dd/yyyy format.
Here is the code:
var isDateTime = DateTime.TryParse("07/22/2022", new CultureInfo("en-US"), DateTimeStyles.None, out _);
On my computer, the above returns false and on two other computers, the same statement is returning true. I am expecting this to return true, but I have no idea why it is returning false on my computer. Can anyone provide a clue on why setting the culture explicitly is not working for me?
EDIT - this is on .NET Framework V4.7.2 on Windows 10 with VS 2022.