More in this section
Forums / Sitefinity SDK / Event Timezone Conversion

Event Timezone Conversion

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Geoff
    Geoff avatar
    89 posts
    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?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    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