Format date within View in ASP.NET Core MVC

前端 未结 9 2140
借酒劲吻你
借酒劲吻你 2020-12-30 09:51

I have problem in regarding with converting the datetime to date using a model.

Model from Class Library

public partial class LoanCo         


        
9条回答
  •  失恋的感觉
    2020-12-30 10:24

    Simple and practical, use asp-format, example:

    
    

    Or:

    @Html.TextBoxFor(model => model.MyDate, "{0:dd/MM/yyyy}", new { @class = "form-control" })
    

提交回复
热议问题