Kendo grid automatically converting timezone?

4 posts, 0 answers
  1. David A.
    David A. avatar
    119 posts
    Member since:
    Aug 2008

    Posted 14 Oct 2012 Link to this post

    Hi,

    I have an application that is strictly used in the central time zone.  Our web server is on pacific time zone.  Data is passed to the web server from the central time zone and I want to display it this way.  Every non-kendo control shows the time as is.  The kendo grid is showing the date with an adjustment of +2 hours so it appears there is a conversion - which I do not want.

    My column format is as follows:

    c.Bound(g => g.LastUpdated).Format("{0:MM/dd/yyyy hh:mm tt}")

    Is it possible to tell the grid to show the date/time "as is"?

    Thanks,
    David A.

  2. Pete
    Pete avatar
    1 posts
    Member since:
    Oct 2012

    Posted 15 Oct 2012 Link to this post

    I'm also trying to do something similar. I am using a remote datasource that uses strings such as "2012-10-15 19:17:07
    " to always represent time in Eastern (both EDT and EST depending on time of year). I am reading this from an XML feed. Is there a way to a) format the data so it is read with date and time, and b) is there a way to leave the time as is?

    schema: {
                    type: "xml",
                    data: "/CMReport/changes/change",
                    model: {
                        fields: {
                            Start:   { type: "date",   field: "startDate/text()" },
                            End:     { type: "date",   field: "endDate/text()" },






  3. Igor
    Igor avatar
    1 posts
    Member since:
    Mar 2013

    Posted 02 Apr 2013 Link to this post

    I'm also looking for something like this. 
    It would be really helpful if kendo would not touch timezone

    EDIT:
    Did little search, this can help somebody else: http://www.kendoui.com/forums/ui/date-time-pickers/format-date-in-grid.aspx

  4. Petur Subev
    Admin
    Petur Subev avatar
    1515 posts
    Member since:
    Sep 2012

    Posted 05 Apr 2013 Link to this post

    Hello,

    Since the dates are created on the client when the response from the server is returned - the dates are always created with an offset according to the timezone of the browser:
    You can try to create date in the browser's console and see the result (you will see the difference if your timezone is different than the UTC 0):

    new Date("2012-01-12T18:45"); 

    Thus said, I suggest you to take a look at this code library:

    http://www.kendoui.com/code-library/mvc/grid/using-utc-time-on-both-client-and-server-sides.aspx


    Kind regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!

Back to Top