Search code examples
c#primitiveprimitive-types

Is DateTime a primitive type?


According to what I can find I believe DateTime is a primitive type but when I check my DateTime variable the property IsPrimitive is false.

7.3 Primitive Types (archive.org mirror)

In the article above you'll see that they say DateTime is primitive. So is there anything I'm doing wrong or have I read the article wrong?


Solution

  • The MSDN page on IsPrimitive lists the .net types that are considered as primitive as far as this method is concerned:

    The primitive types are Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, and Single.

    And DateTime is not in this list.