How do I get today's date in C# in mm/dd/yyyy format?

后端 未结 8 1973
长情又很酷
长情又很酷 2020-12-29 01:00

How do I get today\'s date in C# in mm/dd/yyyy format?

I need to set a string variable to today\'s date (preferably without the year), but there\'s got to be a bette

相关标签:
8条回答
  • 2020-12-29 01:28
    string today = DateTime.Today.ToString("M/d");
    
    0 讨论(0)
  • 2020-12-29 01:31
    DateTime.Now.ToString("dd/MM/yyyy");
    
    0 讨论(0)
提交回复
热议问题