I have a web form and I want to set the default value of tbox.DateEntered.Text = to todays date in mm/dd/yyyy format.
How would I do that in C#?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Feb 5, 2013, 7:53 AM
you may use
DateTime.Now.ToString("MM/dd/yyyy")
it will return 02/05/2013 (today's date)
hopr this will help you.
ZAIN ULARIFEENPosted Feb 5, 2013, 12:51 PM
Jignesh TrivediPosted Feb 5, 2013, 8:10 AM
richard smithPosted Feb 5, 2013, 8:01 AM
tbox.DateEntered.Text = DateTime.Now.ToString("MM/dd/yyyy")