如何防止在 Kendo-UI MVC 中将值 DateTime 对象从 Utc 时区更改为 WebApplication 用户时区

How to prevent to change value DateTime object from Utc time zone to WebApplication user timezone in Kendo-UI MVC

我的 MVC 应用程序遇到了一个问题。在一个模块中,我使用 kendo-ui grid(例如 @(Html.Kendo().Grid(Model)))。问题是,它在网络浏览器上呈现时会更改 DateTime 对象值。前任。如果我在服务器端的 DateTime 对象值为 '2016-09-20 00:00:00' 并且当它在浏览器上呈现时,则此值变为 '2016-09-20 05:30:00' (印度时区 +5:30),在客户端呈现 DateTime对象值添加用户浏览器的时区值。所以我的 DateTime 对象值已更改,我不想更改它。有没有解决此类问题的方法?

日期值由 浏览器 更改,因为 JavaScript 日期对象以本地时区表示。解决方法是使用 UTC:

http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/how-to/utc-time-on-both-server-and-client