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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

System.Windows.Forms.Timer 5
Use of event handling 6
Formatting a datetime 3
How to compare Date? 6
Delay function 8
Linq to Sql insert fails 4
datetime field filled 2
Creating a service 1

Back
Top