cnd
cnd

Reputation: 33764

ASP.NET [How to get current Date from Windows and put into textbox]

How to get current Date from Windows and put into my textbox

Upvotes: 2

Views: 6427

Answers (1)

Ahmad Mageed
Ahmad Mageed

Reputation: 96497

For just the date use:

someTextBox.Text = DateTime.Now.ToShortDateString();

For date and time use:

someTextBox.Text = DateTime.Now.ToString();

You might also want to look at the custom and standard formats available to you.

Upvotes: 4

Related Questions