How to stop Kendo MVC Grid 'messing' with timezones for datetime?

2 posts, 0 answers
  1. Nick Gilbert
    Nick Gilbert avatar
    1 posts
    Member since:
    Aug 2012

    Posted 03 May Link to this post

    Hi,

    We're displaying some data in an Kendo MVC Grid where the source data is stored in local time.  However when it gets printed in the Kendo grid, Kendo seems to assume the source data is in UTC and tries to convert it to the time zone of the web browser.

    So in the database the time is: 2017-05-02 00:00:21.000

    ...but in the grid it displays as : 02/05/2017 01:00

    How can we stop Kendo Grid from attempting to convert the data and just display it literally?

    Thanks,

    Nick

  2. Leon
    Leon avatar
    2 posts
    Member since:
    Dec 2015

    Posted 04 May in reply to Nick Gilbert Link to this post

    I bet you are using the default JSON serializer.. The default serializer will always convert the time on the server to client's timezone. 

    Depending on what you are ultimately trying to archive. One of the simplest solution would be to convert your dates to a string before returning to the client and state the timezone is in UTC.. but then you'll lose all all the feature of having a datetime type.

    See other posts for similar issues. http://www.telerik.com/forums/kendo-grid-automatically-converting-timezone 

Back to Top