System.DateTime.Now

  • Thread starter Thread starter Darren Clark
  • Start date Start date
D

Darren Clark

System.DateTime.Now

it supposedly exists .. but doesnt seem to exist on my machine?

How can i get the current date from the systme?
 
Darren
What error did you get? What is the problem

Tu-Thac

----- Darren Clark wrote: ----

System.DateTime.No

it supposedly exists .. but doesnt seem to exist on my machine

How can i get the current date from the systme
 
Sorry... my mistake...

I was trying to do ..

DateVal = new DateTime().Now;

But that doesnt work....

but..
DateTime myDate = new DateTime();
myDate = DateTime.Now;

works
 
Darren,

You could condense those lines into 1:

DateTime myDate = DateTime.Now;

That way you are not creating a DateTime object just to discard it in the
next line.
 
Back
Top