Event Timezone Conversion

Posted by Community Admin on 05-Aug-2018 16:21

Event Timezone Conversion

All Replies

Posted by Community Admin on 13-Apr-2011 00:00

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

Posted by Community Admin on 13-Apr-2011 00:00

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

This thread is closed