Sometimes very useful, other times not so much, but always present in a developer’s life. And that’s what today’s post is about.
Not “error messages” in general, but one message in particular: “String was not recognized as a valid DateTime.”
As a developer, you’re pretty much guaranteed to have to write code that handles date and time. Which means you’re also bound to have some problems while parsing strings to DateTime values, and that’s what this post will cover.
We’ll start out by talking about the causes of the issue. You’ll learn about globalization and how big a role it plays in the consistency and correction of your application. Then, we’ll close with practical advice on what you can do to prevent such problems from happening in the first place.
Let’s get started!
Download a free trial of CodeIt.Right and get an instant, automated code review.