Search code examples
asp.net-mvcdatetimekendo-gridkendo-asp.net-mvc

Kendo Grid Automatically changing Timezone


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.

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);

Solution

  • This was my solution.

    In the controller I did this:

    DateTime time = DateTime.Now();
    
    string x = time.ToString("MM/dd/yyyy hh:mm:ss tt");
    

    And in the View:

    columns.Bound(p => p.x);
    

    It is also sortable.