ASP.NET MVC JsonResult Date Format

前端 未结 25 3258
渐次进展
渐次进展 2020-11-21 11:22

I have a controller action that effectively simply returns a JsonResult of my model. So, in my method I have something like the following:

return new JsonRes         


        
25条回答
  •  南方客
    南方客 (楼主)
    2020-11-21 11:43

    Annoying, isn't it ?

    My solution was to change my WCF service to get it to return DateTimes in a more readable (non-Microsoft) format. Notice below, the "UpdateDateOriginal", which is WCF's default format of dates, and my "UpdateDate", which is formatted to something more readable.

    Here's how to do it:

    Changing WCF date format

    Hope this helps.

提交回复
热议问题