Kendo Grid自动更改时区 [英] Kendo Grid Automatically changing Timezone
本文介绍了Kendo Grid自动更改时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Kendo网格上,我从服务器接收日期时间.在客户端,此时间更改为客户端的时区,并显示.如何显示从服务器到客户端的同一时间.
On my Kendo Grid I recieve date time from server. On the client end, this time is changed to client's timezone and that is displayed. How can I show the same time from the server to the client.
以下是我绑定日期时间的kendo代码.
the following is my kendo code for binding the datetime.
columns.Bound(p => p.CreateDate).Format("{0:dd/MM/yyyy hh:mm:ss}").Sortable(true).Width(180);
推荐答案
这是我的解决方案
在控制器上,我确实是这样
on controller I did like this
DateTime时间= DateTime.Now();
字符串x = time.ToString("MM/dd/yyyy hh:mm:ss tt");
查看时
columns.Bound(p => p.x);
它也是可排序的.
这篇关于Kendo Grid自动更改时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文