Visual Basic .NET Day(Now)

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

Guest

Hi all,

i need to display the day in a text box.

what is the code for getting

Day(Now)

to be displayed in

Textbox1.Text

I somehow cannot get it to work

Thanks in advance

Murt
 
i need to display the day in a text box.

what is the code for getting

Day(Now)

to be displayed in

Textbox1.Text

I somehow cannot get it to work

Do you mean the weekday or the day number? To get the day:

Textbox1.Text = Date.Now.Day.ToString

- or, shorter -

Textbox1.Text = Date.Today.ToString


Have also a look at the other members of the Date/DateTime data type.
 
you could try
format(now(),"dddd") if you want the full day
format(now(),"ddd") for a shorter version of the day
format(now(),"dd") for the day in nrs like 02
 
many thanks,

is there a resource where one can see the differant
formats particularly for date, time, year etc.?

thanks

Murt
 
Back
Top