What's in a DateTime? Or more specifically what's in .NET System.DateTime? Here is a class that we use every day yet few people really understand. I too had a wrong understanding of it until very recently and it's only now that I feel confident enough (or maybe it's just an illusion?) to write this post to organize my thoughts and try to help others, including my future self.
DISCLAIMER: This article contains some simplifications (e.g. UTC is not formally timezone 0) for the sake of a better explanation.
DateTimes are known for being particularly tricky in computing, this is because they mix two similar yet different concepts. Let's start by defining the simplest of them. We'll use another word to make the distinction more clear: timestamp. What's a timestamp in computing terms? It's just a value in a unidimensional coordinate system that defines how far is a point from the coordina