我正在研究MVC 4.0./C#/Razor视图.在模型中我有一个约会
[Display(Name = "For Period")]
[DisplayFormat(DataFormatString = "{0:dd-MMM-yyyy}")]
public System.DateTime ForPeriod { get; set; }
Run Code Online (Sandbox Code Playgroud)
在视图中我正在使用日期
@Html.DisplayFor(modelItem => item.ForPeriod)
Run Code Online (Sandbox Code Playgroud)
结果我得到了"2015年5月12日"格式的约会.我想从这个日期跳过这一天,结果我想要"2015年5月".
我的问题是我应该在View中使用什么来获得这种"MMM-yyyy"格式?