How do I display MM/dd/yyyy (no time) in my DataGridView column?

后端 未结 7 549
臣服心动
臣服心动 2021-01-15 18:41

I need help on my DataGridView column date format. I want the date to be \"MM/dd/yyyy\". I dont need the time.

How can this be done programmatically?

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-15 19:18

    The easiest way is to use DateTime.ToShortDateString() or DateTime.ToLongDateString()

    If neither of those formats works take a look at DateTime.ToString(string)

提交回复
热议问题