MVC更改日期类型在视图中

时间:2019-05-10 10:58:44

标签: html asp.net-mvc date

我想将该日期类型更改为月/年。 我该怎么办?

Date format image

public Nullable<System.DateTime> Month { get; set; }

<div class="form-group">
     @Html.LabelFor(m => m.Month, new { @class = "control-label col-sm-3" })
     <div class="col-sm-9 input-group date">
         @Html.EditorFor(model => model.Month, new { htmlAttributes = new { @class = "form-control input-circle " } })
         @Html.ValidationMessageFor(model => model.Month, "", new { @class = "text-danger " })
     </div>
 </div>

0 个答案:

没有答案