Avoid having DateTime.TryParse throwing (dotnet/coreclr#20587)
authorTarek Mahmoud Sayed <tarekms@microsoft.com>
Thu, 25 Oct 2018 05:19:17 +0000 (22:19 -0700)
committerStephen Toub <stoub@microsoft.com>
Thu, 25 Oct 2018 05:19:17 +0000 (22:19 -0700)
commit52c6d519a05694df36972c935d9f401ee5d25751
tree0cef8df79f4853554e964ab92053b79a45668339
parentab2333042f3dd067b3fc9836c83809bd25b24f1b
Avoid having DateTime.TryParse throwing (dotnet/coreclr#20587)

* Avoid having DateTime.TryParse throwing

There are some cases during the parsing which will require adding ticks to the DateTime object we are creating during the parsing.
DateTime.AddTicks can throw which will make DateTime.TryParse fail with throwing instead of just returning false.

The fix here is to avoid throwing in the first place and let DateTime.TryParse return false on such failures.

* Remove the invalid link

Commit migrated from https://github.com/dotnet/coreclr/commit/2439be06aae193e6cd04442d344c02ec9629d04d
src/libraries/System.Private.CoreLib/src/System/DateTime.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs