Date Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a label - lblDate and when my form loads I want the current date to
show up in it. I have started the Form Load Event but cannot get the Date
Function to work properly. Can anyone tell me how to get the current date in
my label?

Thanks in advance
 
In your form load event,

lblDate.Text = System.DateTime.Now.ToString()

Show us the code you are using so we can help you better.
 
Playa said:
Can anyone tell me how to get the current date in
my label?

\\\
Me.Label1.Text = Now().Date.ToShortDateString()
///
 
Addendnum:

You can omit the '.Date' in the code I posted.
 
Cor,

Cor Ligthert said:
Me.Label1.Text = Now().ToShortString()

I thried it, it does not work

I said '.Date', not 'Date' (note the small difference...) :-).
 
When I tried this in VB 6, I received a compile error:
Method or Data member not found.
Is there a reference I need to include?
Thanks,
Ann
 

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

Back
Top