Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / December 2004

Tip: Looking for answers? Try searching our database.

DateTime is not CLS compliant

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Mark Howell - 10 Dec 2004 04:23 GMT
What are we supposed to use for a DateTime if we want to stay CLS
compliant????
Daniel O'Connell [C# MVP] - 10 Dec 2004 06:50 GMT
> What are we supposed to use for a DateTime if we want to stay CLS
> compliant????

DateTime doesn't appear to be marked as not ClsCompliant. Where are you
seeing that it is?
John Mark Howell - 10 Dec 2004 16:05 GMT
Here it is straight out of the MSDN:
The .NET Framework class library includes types that correspond to the
primitive data types that compilers use. Of these types, the following are
CLS-compliant: Byte, Int16, Int32, Int64, Single, Double, Boolean, Char,
Decimal, IntPtr, and String. For more information about these types, see the
table of types in .NET Framework Class Library.

> > What are we supposed to use for a DateTime if we want to stay CLS
> > compliant????
>
> DateTime doesn't appear to be marked as not ClsCompliant. Where are you
> seeing that it is?
Shawn B. - 10 Dec 2004 22:02 GMT
It doesn't say that DateTime is not CLS compliant, what it is saying is that
the compiler has aliases that correspond to the CLS type.  For example, in
C# you say "int" not "System.Int32", or "bool" and not "System.Boolean", and
so on.  There is not C# keyword for System.DateTime so you just simply use
DateTime.

In VB, its similar, you say "Integer" instead of "System.Int32" and "Short"
instead of "System.Int16", except in this case, you can say "Date" instead
of "System.DateTime" because there is a keyword but C# has no keyword or
"alias".

The fact that it isn't listed doesn't mean that it is not CLS compliant,
simply just means there isn't a corresponding primitive data type that maps
to a type in the Framework somewhere.

Thanks,
Shawn

> Here it is straight out of the MSDN:
> The .NET Framework class library includes types that correspond to the
[quoted text clipped - 8 lines]
> > DateTime doesn't appear to be marked as not ClsCompliant. Where are you
> > seeing that it is?
Bruno Jouhier [MVP] - 14 Dec 2004 12:17 GMT
This list is about PRIMITIVE data types. The fact that DateTime is not
listed does not mean anything because DateTime is not a primitive type.

> Here it is straight out of the MSDN:
> The .NET Framework class library includes types that correspond to the
[quoted text clipped - 9 lines]
>> DateTime doesn't appear to be marked as not ClsCompliant. Where are you
>> seeing that it is?
John Mark Howell - 10 Dec 2004 16:07 GMT
Sorry, I forgot to send you the link
ms-help://MS.MSDNQTR.2004APR.1033/cpguide/html/cpconWhatIsCommonLanguageSpecification.htm

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.