解决Asp.net Mvc返回JsonResult中DateTime类型数据格式问题的方法

2019-05-22 16:18:28于海丽

最后我们在自己的Controller中调用即可

public class ProjectMileStoneController : BaseController
  {
    /// <summary>
    /// 首页视图
    /// </summary>
    /// <returns>视图</returns>
    public ActionResult Index()
    {
      return this.View();
    }

    #region 项目里程碑查询

    /// <summary>
    /// 根据项目编号获取项目里程碑
    /// </summary>
    /// <param name="projectId">项目编号</param>
    /// <returns>项目里程碑</returns>
    public JsonResult GetProjectMileStoneByProjectId(int projectId)
    {
      IList<ProjectMileStone> projectMileStones = FacadeContainer.Get<IProjectMileStoneService>().GetProjectMileStonesByProjectId(projectId);
      return this.MyJson(projectMileStones, "yyyy.MM.dd");
    }

    #endregion
  }

原文地址:http://www.cnblogs.com/JerryWang1991

以上就是Asp.net Mvc返回JsonResult中DateTime类型数据格式问题的解决方法,希望对大家的学习有所帮助。