If I were to summarize DateTime.Now using one word, it would be “don’t.” DateTime.Now is a very problematic way of retrieving the current date and time, and you should—almost—never use it.
But that would make for a super short post and an incredibly unhelpful one at that. It’s not enough to say you shouldn’t use a given approach without going further to explain why it’s problematic and what to do instead.
So, that’s what we’re going to do now—take a look at the dos and don’ts of DateTime.Now as well as a few best practices and alternatives. Let’s get started.