how to give format DateTime.Date?

前端 未结 7 656
滥情空心
滥情空心 2021-01-29 10:47

DateTime dt = DateTime.Now dt.Date is created to 31.10.2012 00:00:00 .it is created to dd.mm.yyyy format but i need dd/mm/yyyy. Can i use: return new DateTime(d.Year, d.Month

7条回答
  •  悲哀的现实
    2021-01-29 11:21

    In you case you can simply use :

    dt.ToString("dd/MM/yyyy");
    

    Anyway there al the string format you can use with DateTime : Here.

提交回复
热议问题