Saving time as UTC

Hi,


I'm having trouble using the Scheduler across different timezones. I use a CustomDataAdapter to save schedules in a database. According to Timezone in Blazor Scheduler Component | Syncfusion, if I want to display a schedule created in New York in London, it should be saved in New York time with the New York timezone.

new Schedule { StartTime = new DateTime(2025, 3, 31, 10, 0, 0), EndTime = new DateTime(2025, 3, 31, 12, 0, 0),
StartTimezone = "American/New_York",
EndTimezone = "American/New_York"
}

I'm facing a dilemma when reading the schedule's StartDate and EndDate from the database, considering the timezone. Specifically:

  1. When I read DateTime with Kind.Local considering the timezone, the Scheduler shows datetime incorrectly.
  2. The reason I need to read DateTime as local is to compare it with other events in different timezones.

To get around this issue, I'm thinking of convertings the StartTime and EndTime in UTC with StartTimezone and EndTimezone of UTC. Do you think this is a good idea?


10 Replies

SR Swathi Ravi Syncfusion Team April 1, 2025 12:18 PM UTC

Hi Yongkee,


Thank you for reaching out to us.


To display appointments in their respective time zones, set the Scheduler's timezone to UTC and specify the StartTimeZone and EndTimeZone for each appointment accordingly. Alternatively, you can change the Scheduler’s Timezone to match the desired display timezone.


Demo for reference, https://blazor.syncfusion.com/demos/scheduler/timezone?theme=fluent2


Additionally, the Scheduler processes events using the local timezone and for the timezone conversion we have used the Outlook's TimeZoneInfo property. You can find more details in the reference below:

https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo?view=net-9.0


Regards,

Swathi



YC Yongkee Cho April 1, 2025 06:30 PM UTC

Sorry, sttill confused. When an user in Los Angeles creates an event which starts at 2025-03-25 11:15AM. There are 9 combinations below are possible, which one is right way?

Scheduler StartTime StartTimezone
Browser 2025-03-25 11:15AM America/Los_Angeles
Browser 2025-03-25 6:15PM UTC
Browser 2025-03-25 6:15PM null
UTC 2025-03-25 11:15AM America/Los_Angeles
UTC 2025-03-25 6:15PM UTC
UTC 2025-03-25 6:15PM null
. 2025-03-25 11:15AM America/Los_Angeles
. 2025-03-25 6:15PM UTC
. 2025-03-25 6:15PM null


Where, Scheduler is SyncFusion Blazor SfSchedule's Timezone property, 'Browser' refers user's timezone, '.' refers not specifying Timezone property. StartTime and StartTimezone columns are the values saved in database.




YC Yongkee Cho April 1, 2025 06:30 PM UTC

Sorry, sttill confused. When an user in Los Angeles creates an event which starts at 2025-03-25 11:15AM. There are 9 combinations below are possible, which one is right way?

Scheduler StartTime StartTimezone
Browser 2025-03-25 11:15AM America/Los_Angeles
Browser 2025-03-25 6:15PM UTC
Browser 2025-03-25 6:15PM null
UTC 2025-03-25 11:15AM America/Los_Angeles
UTC 2025-03-25 6:15PM UTC
UTC 2025-03-25 6:15PM null
. 2025-03-25 11:15AM America/Los_Angeles
. 2025-03-25 6:15PM UTC
. 2025-03-25 6:15PM null


Where, Scheduler is SyncFusion Blazor SfSchedule's Timezone property, 'Browser' refers user's timezone, '.' refers not specifying Timezone property. StartTime and StartTimezone columns are the values saved in database.




YC Yongkee Cho April 1, 2025 06:30 PM UTC

Sorry, sttill confused. When an user in Los Angeles creates an event which starts at 2025-03-25 11:15AM. There are 9 combinations below are possible, which one is right way?

Scheduler StartTime StartTimezone
Browser 2025-03-25 11:15AM America/Los_Angeles
Browser 2025-03-25 6:15PM UTC
Browser 2025-03-25 6:15PM null
UTC 2025-03-25 11:15AM America/Los_Angeles
UTC 2025-03-25 6:15PM UTC
UTC 2025-03-25 6:15PM null
. 2025-03-25 11:15AM America/Los_Angeles
. 2025-03-25 6:15PM UTC
. 2025-03-25 6:15PM null


Where, Scheduler is SyncFusion Blazor SfSchedule's Timezone property, 'Browser' refers user's timezone, '.' refers not specifying Timezone property. StartTime and StartTimezone columns are the values saved in database.




YC Yongkee Cho April 1, 2025 06:34 PM UTC

Sorry, sttill confused. When an user in Los Angeles creates an event which starts at 2025-03-25 11:15AM (local time) or 2025-03-25 6:15PM (UTC). There are 9 combinations below are possible, which one is right way?

Scheduler StartTime StartTimezone
Browser 2025-03-25 11:15AM America/Los_Angeles
Browser 2025-03-25 6:15PM UTC
Browser 2025-03-25 6:15PM null
UTC 2025-03-25 11:15AM America/Los_Angeles
UTC 2025-03-25 6:15PM UTC
UTC 2025-03-25 6:15PM null
. 2025-03-25 11:15AM America/Los_Angeles
. 2025-03-25 6:15PM UTC
. 2025-03-25 6:15PM null


Where, Scheduler is SyncFusion SfSchedule Blazor control's Timezone property, 'Browser' refers user's timezone obtained from Javascript, '.' refers not specifying Timezone property. StartTime and StartTimezone columns are the values saved in database.




SS Saritha Sankar Syncfusion Team April 3, 2025 12:51 PM UTC

Hi Yongkee Cho,


Thank you for reaching out to us.


There are three ways to use time zones in the Scheduler:

  1. Display appointments based on the Scheduler’s time zone:
    • If you set the time zone for the Scheduler, there is no need to set the StartTimezone and EndTimezone for appointments separately.
    • In this case, the appointments will automatically follow the time zone set in the Scheduler.

Example:

·       A company in New York manages a Scheduler.

·       The Scheduler’s time zone is set to America/New_York.

·       An event is scheduled at 10 A.M. New York time.

A user in Chennai will also see 10 A.M. New York time, meaning they must manually calculate their local time.

Key Point: Everyone sees the event in New York time, regardless of their location.

  1. Display appointments based on the client’s time zone:
    • The Scheduler's time zone should be set dynamically based on the browser's time zone.
    • Additionally, each appointment should have its StartTimezone and EndTimezone set specifically to ensure proper scheduling.

Example:

·       A manager in New York schedules a meeting at 10 A.M. New York time.

·       The Scheduler detects the user’s browser time zone and adjusts the appointment accordingly.

A user in Chennai sees it at 8:30 P.M. Chennai time.

Key Point: Each user sees the meeting in their own time zone automatically.

  1. Display appointments at the same time everywhere, regardless of the client’s time zone:
    • To show appointments at a fixed time across all locations, set the Scheduler’s Timezone property while keeping StartTimezone and EndTimezone as null.
    • This ensures that appointments appear at the same time everywhere, based solely on their StartTime and EndTime, without adjusting for different time zones.

Example:

·       A live webinar is scheduled for 10 A.M. globally.

·       The Scheduler does not adjust for different time zones.

A user in New York joins at 10 A.M. New York time.

A user in Chennai joins at 10 A.M. Chennai time.

Key Point: The event time stays the same, no matter the user’s location.

Refer UG: Timezone in Blazor Scheduler Component | Syncfusion

Please review the available options and determine which one best fits your scenario. You may proceed with implementing the most suitable approach accordingly.


Regards,

Saritha S.



YC Yongkee Cho April 3, 2025 01:30 PM UTC

Saritha, my case is #2. Display appointments based on the client’s time zone:

I followed instructions and encountered an issue where the StartTime in the calendar is displayed incorrectly. In my example, your suggestion, #1 doesn't work. While the editor shows StartTime correctly, calendar shows wrong one. So I am asking if #2 and #3 wi


SchedulerStartTimeStartTimezone
1Client's timezone2025-03-25 11:15AMAmerica/Los_Angeles
2Client's timezone2025-03-25 6:15PMUTC
3Client's timezone2025-03-25 6:15PMnull


SS Saritha Sankar Syncfusion Team April 7, 2025 10:31 AM UTC

Hi Yonkgee Cho,


We would like to suggest setting the StartTimezone property to null to ensure that the event times are correctly aligned with the client’s local timezone. When StartTimezone is set to null, the Scheduler automatically uses the client's browser timezone to render the events appropriately.


If you continue to face issues after applying this approach, we kindly request you to share a reproducible sample or a video demonstration of the issue. This will help us analyze the behavior more effectively and provide you with a precise solution.


Regards,

Saritha S.



YC Yongkee Cho April 7, 2025 01:11 PM UTC

Hi Saritha, Thank you for the reply. I got your point but I guess my question is if StartTime in database must be saved in UTC or not when StartTimeZone is null.



SS Saritha Sankar Syncfusion Team April 8, 2025 09:49 AM UTC

Hi Yongkee Cho,


When the StartTimeZone is set to UTC, the events will be saved in UTC time and displayed accordingly in UTC. To assist you further, we kindly request you to share more details about your specific scenario so we can understand your requirement better.

Additionally, please provide a complete runnable sample along with a video demonstration of the issue. This will help us thoroughly analyze the problem and offer a precise solution.

Looking forward to your response.


Regards,

Saritha S.


Loader.
Up arrow icon