I'm using following code in my project but "DateTime.TryParse" gives different results in different machine. IsDate method returns "False" on my machine and return "True" on another machine.
if(IsDate("30/03/2020 04:00",out dt))
{
}
private bool IsDate(object o, out DateTime date)
{
return DateTime.TryParse(o.ToString(), CultureInfo.CurrentCulture, DateTimeStyles.None, out date);
}
I have also tried "DateTime.TryParseExact" as per in below article, but no use. https://github.com/dotnet/runtime/issues/25120
Please suggest me any ideas to make it work properly.
Thanks.