Issue with TimZone addition to time

3 posts, 1 answers
  1. Shreesh
    Shreesh avatar
    33 posts
    Member since:
    Aug 2011

    Posted 12 Feb 2015 Link to this post

    I am using MVC5 wrappers for DateTIme in Kendo  Grid (ASP NET MVC wrappers)
    My application works correctly when test it locally for date time, however when I deploy it on Azure website then issues starts. Timezone gets added to the datetime picker at time of display. I would like to keep it as UTC and not finding any proper solution.

    I looked at following links but found none for MVC wrappers. I did not get what exactly to be done.
    http://www.telerik.com/support/code-library/using-utc-time-on-both-client-and-server-sides
    http://www.telerik.com/forums/timezone-issue
    http://stackoverflow.com/questions/18718996/format-datetime-in-kendo-ui-grid-using-asp-net-mvc-wrapper

    So as a fallback approach, I just converted date time to string as mydate.ToString("MM/dd/yyyy hh:mm tt");
    However, I do not think this is right approach and feel there has to be better way rather than converting to string. Please let me know the correct solution and any sample code will help for using Datetime (Time is important for me) with Kendo Grid.
  2. Shreesh
    Shreesh avatar
    33 posts
    Member since:
    Aug 2011

    Posted 13 Feb 2015 in reply to Shreesh Link to this post

    I could solve using js from one of the links. Its working properly for me.
    However, I would like to know can it be done completely in c#?
  3. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1444 posts

    Posted 16 Feb 2015 Link to this post

    Hello Shreesh,

    This can hardly be done on the server-side, as the timezone offset is added on the client-side during the creation of the Date object. Additionally, the offset is different depending on the time-zone in which the client machine is, preventing you from properly calculating the dates on the server.

    Regards,
    Alexander Popov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top