Any advices how to increase the performance of DateTime.FromString?
I compared the old ParseDate to the new DateTime.FromString function.
Unfortunately the new one is about 300 times slower than the old one.
ParseDate returns a boolean which verifies if the conversion happened correctly. However the DateTime.FromString does not seem to have a way to check if a conversion occurred correctly. Am I missing something? I hate to just assume every date conversion will always work.
If something goes wrong with DateTime.FromString you will get a runtime exception. This is mentioned in the documentation, but it neglects to say what kind of exception to catch. You’ll have to test that, I’m no longer at my desk today.