Timezone problem in the GetOccurences method

Hello.

I have a big issue with timezones when using the GetOccurrences method in my ASP.NET controller.

I have a server where I store schedule start and end in UTC. Then I have a method where I check if the schedule is playing right now. I use the scheduler in the view and choose for instance the recurring pattern: Weekly -> Wednesday -> No end date - Time period: 00:00 19 November - 06:00 19 November

The problem is that when I schedule something for every Wednesday from 00:00 to 06:00 and I’m located in Norway the value will be stored in UTC which is 23:00 in the database. This works fine in the view client side where the scheduler know that the schedules rendered are stored in UTC and display local time. But the .NET GetOccurrences method in the controller does not have this information and translates the recurring pattern and startdate information to be every Wednesday from 23:00 to 05:00 the morning after. While it should have been every Wednesday from 00:00 to 06:00, It skips a whole day.

I can therefore not get the occurrences of that schedule in my controller. This will be a big problem if I use the scheduler across different timezones. How can I fix this?

Thank you.

Hello,
I’m not quite get it. In which case the result of client-side parsing is differs from the GetOccurrences?
Since the GetOccurrences works with UTC dates, the server-side data does not depends on a timezone of the client. This means you can get UTC dates and convert them to the certain timezone, and get the same result as the client.

Note that you probably need to enable this config for a correct work of recurring events in different timezones, by default client-side scheduler expects that all users are in the same time zone

DHXScheduler.Config.occurrence_timestamp_in_utc = true;