Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# compiler error... 1

Status
Not open for further replies.

fletchsod

Programmer
Dec 16, 2002
181
I give up, I spend 30 minutes on it and cuoldn't get it to compile..

Code:
System.DateTime dApplication = new System.DateTime().Date.Now;

It give varity of errors when I kept changing the "Date.Now" object...
 
System.DateTime dApplication = DateTime.Now;
Sytem.DateTime mytime = new DateTime(year, month, day, hour, minute, second);

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Oh finally! I'm going to write it down and save it so I can alway look it up if I forget again. For some reasons, there are varity of objects, so it makes it more complicated to remember.

Thanks...
 
[tt]Now[/tt] is a static member of DateTime so you don't need to create an instance to access it.

Chip H.


____________________________________________________________________
www.chipholland.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top