Why the error?

BaA

New Member
Why this error:<BR>CS0119: 'System.DateTime' denotes a 'class' which is not valid in the given context<BR><BR>with this code:<BR>DateTime dtDate = DateTime().Now;<BR>ThanksTry just<BR>DateTime dsDate = DateTime.Now;is that the DateTime structure contains a property named Now, which returns a DateTime structure that is populated wiht the current system's date/time. There is no Now() method, hence the reason: DateTime.Now() fails.thanks
 
Back
Top