i have a DateTime Field that must be shown in Edit view
@Html.EditorFor( model => model.StartDate )
how can i use somthing like this ;
@Html.EditorFor( model => model.StartDate.ToShortDateString() )
or any custom function for changing the DateTime for view.
Use the
[DisplayFormat]
attribute on your view model:and then in your view simply: