DisplayToUtc

2 posts, 1 answers
  1. Roatin Marth
    Roatin Marth avatar
    65 posts
    Member since:
    Nov 2007

    Posted 25 Aug 2011 Link to this post

    I've recently been updating some of my out dated scheduler code to use the newer UI dll's as well as newer custom advanced from templates.

    I've noticed the use of this DisplayToUtc method in some area. 

    I was hoping someone could expand on the little documentation on this method and perhaps comment on where and how it should be used.

    I just did a test in the save click method of the advanced form. I chose Aug 25th at 9am as the start date. 

    >>> apt.get_start()
    Date {Thu Aug 25 2011 09:00:00 GMT-0400 (Eastern Daylight Time)}
     
    >>> this._scheduler.displayToUtc(apt.get_start())
    Date {Thu Aug 25 2011 09:00:00 GMT-0400 (Eastern Daylight Time)}

    So no change in that example.
    I'm wondering in what cases should I xpect there to be a change and how this method was intended to be used

    regards,
    roatin
  2. Answer
    Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 30 Aug 2011 Link to this post

    Hello Roatin,

    The displayToUtc(DateTime arg) method should convert the DateTime arg in a UTC±0 DateTime object.

    I tested your example and displayToUtc will convert the apt.get_start() DateTime object only if the
    TimeZoneOffset property of the RadScheduler is set.
    Ex:
    If the apt.get_start() returns "Thu Aug 25 2011 09:00:00", then having set the property TimeZoneOffset="03:00:00", the call of displayToUtc(apt.get_start()) will return
    "Thu Aug 25 2011 06:00:00".

    Greetings,
    Ivana
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top