Most common datatypes have a built in type: Int32
has int
, Boolean
has bool
, String
has string
, etc. Why is there no built-in type for DateTime?
First I thought it's because DateTime
has properties and public functions, but so does int
. Can anyone shed some light on this? What's the criteria for a type to have a built-in equivalent?
The CLR only defines basic building blocks: the minimal data types necessary to define all others. Those are the types given an alias.
Since DateTime
is just a collection of longs and integers, packed in a struct, there is no need to create a new data type in the CLR for it. You can build it with the data types already defined in the CLR. No need for aliasing it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With