Date object versus DateTime object

I am currently browsing msdn pages for a date and datetime object. I also opened the reflector, and it looks like the date and datetime object refer only to the Date structure . Why do we have two objects that reference the same structure? what is the difference between them?

+5
source share
2 answers

CLR classes (e.g. DateTime, Int32etc.) contain the actual implementation. This is what you will see in Reflector.

Due to its legacy, C # and VB define specific aliases for commonly used data types. For example, intin C # is an alias Int32. In VB, one such alias Datefor DateTime.

Here is a list of these aliases:

+7
source

No type Date. There is only a type DateTimethat you should use for any date or date and time data.

0
source

All Articles