How to Convert date into MM/DD/YY format in C#

后端 未结 5 1320
自闭症患者
自闭症患者 2020-12-05 07:19

In My Asp.net webpage I need to display today\'s date into one of the textbox , so in my form load I wrote the following code

textbox1.text = System.DateTi         


        
5条回答
  •  执笔经年
    2020-12-05 07:27

    Have you tried the following?:

    textbox1.text = System.DateTime.Today.ToString("MM/dd/yy");
    

    Be aware that 2 digit years could be bad in the future...

提交回复
热议问题