Event Timezone Conversion - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Event Timezone Conversion

  • Event Timezone Conversion
  • 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?

  • 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 >>