Why does DisplayFormat with DataFormatString changes “/” (slash) to “-” (dash)?

后端 未结 3 1301
挽巷
挽巷 2020-12-31 04:21

I\'m using the following code

// Model
[DisplayFormat(
    ApplyFormatInEditMode = true, 
    DataFormatString = \"{0:dd/MM/yyyy}\")]
public DateTime StartDa         


        
3条回答
  •  無奈伤痛
    2020-12-31 04:54

    Can you change it to DataFormatString = "{0:d}"

    That should give you the short date pattern of mm/dd/year

提交回复
热议问题