I have been looking through the DateTime structure and I am slightly confused.
My understanding with structs is that you cannot assign \'default values\' of fields. If t
Jon Skeet is right it's all about the difference between fields and other members. One could really make a "date time" like this:
struct MyDateTime
{
// This is the only instance field of my struct
// Ticks gives the number of small time units since January 1, 0001, so if Ticks is 0UL, the date will be just that
readonly ulong Ticks;
// here goes a lot of instance constructors,
// get-only instance properties to show (components of) the DateTime in a nice way,
// static helper methods,
// and lots of other stuff, but no more instance fields
...
}
So in reality, MyDateTime
is just a wrapped ulong
with an interpretation, and a lot of nice ways to show and manipulate that ulong
.