+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Event Timezone Conversion

Event Timezone Conversion

2 posts, 0 answered
  1. Geoff
    Geoff avatar
    89 posts
    Registered:
    02 Mar 2011
    13 Apr 2011
    Link to this post
    I noticed that when Events are retrieved from the Sitefinity API, the EventStart and EventEnd properties are in UTC.  When I display these values, I have been using .ToLocalTime() to convert them to the local timezone.  However, I am also populating a RadScheduler datasource with these Events.  How would I go about converting the EventStart and EventEnd properties for the RadScheduler datasource, so they will be displayed correctly in a calendar format?

    -Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    13 Apr 2011
    Link to this post
    Hi Geoff,

    Sitefinity has a static method of SystemExtensions - ToLocal().The method gets the default time zone set under Administration >Settings. If there is no value set there we use TimeZoneInfo.ConvertTime. In both the case the method returns DateTime which should be accepted by RadScheduler or RadCalendar controls.
    RadScheduler works with appointments, so basically you need to create a new appointment on the same date when the event starts. There is also a server side event AppointmentInsert that you can use to get access to the Appointment that will be created

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

2 posts, 0 answered