Time Zone in Xamarin Scheduler (SfSchedule)
18 May 202110 minutes to read
Schedule allows you create appointments in various time zones and display them in users’ time zone or any other time zone. You can use a time zone in the following four different ways:
- Create appointments in different time zones
- Display appointments based on the client’s time zone
- Display appointments based on schedule time zone
- Display appointments at the same time everywhere regardless of client’s time zone
We have added the following Time Zone’s for the respective countries to cover all the time zone regions, you can use any of the time zone’s from the following list for schedule time zone.
Time Zone | Region | UTC Offset |
---|---|---|
Samoa Standard Time | Pacific/Apia | UTC - 13:00 |
Dateline Standard Time | Etc/GMT+12 | UTC - 12:00 |
UTC-11 | Pacific/Midway | UTC - 11:00 |
Hawaiian Standard Time | Pacific/Honolulu | UTC - 10:00 |
Alaskan Standard Time | America/Anchorage | UTC - 09:00 |
Pacific Standard Time | America/Los_Angeles | UTC - 08:00 |
Pacific Standard Time (Mexico) | America/Santa_Isabel | UTC - 08:00 |
Mountain Standard Time | America/Denver | UTC - 07:00 |
Mountain Standard Time (Mexico) | America/Chihuahua | UTC - 07:00 |
US Mountain Standard Time | America/Phoenix | UTC - 07:00 |
Canada Central Standard Time | America/Regina | UTC - 06:00 |
Central America Standard Time | America/Guatemala | UTC - 06:00 |
Central Standard Time | America/Chicago | UTC - 06:00 |
Eastern Standard Time | America/New_York | UTC - 05:00 |
SA Pacific Standard Time | America/Bogota | UTC - 05:00 |
US Eastern Standard Time | America/Indianapolis | UTC - 05:00 |
Venezuela Standard Time | America/Caracas | UTC - 04:30 |
Atlantic Standard Time | America/Halifax | UTC - 04:00 |
Central Brazilian Standard Time | America/Cuiaba | UTC - 04:00 |
Pacific SA Standard Time | America/Santiago | UTC - 04:00 |
Paraguay Standard Time | America/Asuncion | UTC - 04:00 |
SA Western Standard Time | America/La_Paz | UTC - 04:00 |
Newfoundland Standard Time | America/St_Johns | UTC - 03:30 |
Bahia Standard Time | America/Bahia | UTC - 03:00 |
Argentina Standard Time | America/Buenos_Aires | UTC - 03:00 |
E. South America Standard Time | America/Sao_Paulo | UTC - 03:00 |
Greenland Standard Time | America/Godthab | UTC - 03:00 |
Montevideo Standard Time | America/Montevideo | UTC - 03:00 |
SA Eastern Standard Time | America/Cayenne | UTC - 03:00 |
UTC-02 | America/Noronha | UTC - 02:00 |
Azores Standard Time | Atlantic/Azores | UTC - 01:00 |
Cape Verde Standard Time | Atlantic/Cape_Verde | UTC - 01:00 |
GMT Standard Time | Europe/London | UTC |
Greenwich Standard Time | Atlantic/Reykjavik | UTC |
Morocco Standard Time | Africa/Casablanca | UTC |
UTC | America/Danmarkshavn | UTC |
Central Europe Standard Time | Europe/Budapest | UTC + 01:00 |
Central European Standard Time | Europe/Warsaw | UTC + 01:00 |
Namibia Standard Time | Africa/Windhoek | UTC + 01:00 |
Romance Standard Time | Europe/Paris | UTC + 01:00 |
W. Central Africa Standard Time | Africa/Lagos | UTC + 01:00 |
W. Europe Standard Time | Europe/Berlin | UTC + 01:00 |
Egypt Standard Time | Africa/Cairo | UTC + 02:00 |
FLE Standard Time | Europe/Kiev | UTC + 02:00 |
GTB Standard Time | Europe/Bucharest | UTC + 02:00 |
Israel Standard Time | Asia/Jerusalem | UTC + 02:00 |
Libya Standard Time | Africa/Tripoli | UTC + 02:00 |
Middle East Standard Time | Asia/Beirut | UTC + 02:00 |
South Africa Standard Time | Africa/Johannesburg | UTC + 02:00 |
Syria Standard Time | Asia/Damascus | UTC + 02:00 |
Turkey Standard Time | Europe/Istanbul | UTC + 02:00 |
Arab Standard Time | Asia/Riyadh | UTC + 03:00 |
Arabic Standard Time | Asia/Baghdad | UTC + 03:00 |
Belarus Standard Time | Europe/Minsk | UTC + 03:00 |
E. Africa Standard Time | Africa/Nairobi | UTC + 03:00 |
Jordan Standard Time | Asia/Amman | UTC + 03:00 |
Kaliningrad Standard Time | Europe/Kaliningrad | UTC + 03:00 |
Iran Standard Time | Asia/Tehran | UTC + 03:30 |
Arabian Standard Time | Etc/GMT-4 | UTC + 04:00 |
Azerbaijan Standard Time | Asia/Baku | UTC + 04:00 |
Caucasus Standard Time | Asia/Yerevan | UTC + 04:00 |
Georgian Standard Time | Asia/Tbilisi | UTC + 04:00 |
Mauritius Standard Time | Indian/Mauritius | UTC + 04:00 |
Russia Time Zone 3 | Europe/Samara | UTC + 04:00 |
Russian Standard Time | Europe/Moscow | UTC + 04:00 |
Afghanistan Standard Time | Asia/Kabul | UTC + 04:30 |
Pakistan Standard Time | Asia/Karachi | UTC + 05:00 | West Asia Standard Time | Asia/Tashkent | UTC + 05:00 |
India Standard Time | Asia/Calcutta | UTC + 05:30 |
Sri Lanka Standard Time | Asia/Colombo | UTC + 05:30 |
Nepal Standard Time | Asia/Kathmandu | UTC + 05:45 |
Bangladesh Standard Time | Asia/Dhaka | UTC + 06:00 |
Central Asia Standard Time | Asia/Almaty | UTC + 06:00 |
Ekaterinburg Standard Time | Asia/Yekaterinburg | UTC + 06:00 |
Myanmar Standard Time | Asia/Rangoon | UTC + 06:30 |
SE Asia Standard Time | Asia/Bangkok | UTC + 07:00 |
N. Central Asia Standard Time | Asia/Novosibirsk | UTC + 07:00 |
China Standard Time | Asia/Shanghai | UTC + 08:00 |
North Asia Standard Time | Asia/Krasnoyarsk | UTC + 08:00 |
Singapore Standard Time | Asia/Singapore | UTC + 08:00 |
Taipei Standard Time | Asia/Taipei | UTC + 08:00 |
Ulaanbaatar Standard Time | Asia/Ulaanbaatar | UTC + 08:00 |
W. Australia Standard Time | Australia/Perth | UTC + 08:00 |
Korea Standard Time | Asia/Seoul | UTC + 09:00 |
North Asia East Standard Time | Asia/Irkutsk | UTC + 09:00 |
Tokyo Standard Time | Asia/Tokyo | UTC + 09:00 |
AUS Central Standard Time | Australia/Darwin | UTC + 09:30 |
Cen. Australia Standard Time | Australia/Adelaide | UTC + 09:30 |
AUS Eastern Standard Time | Australia/Sydney | UTC + 10:00 |
E. Australia Standard Time | Australia/Brisbane | UTC + 10:00 |
Tasmania Standard Time | Australia/Hobart | UTC + 10:00 |
West Pacific Standard Time | Pacific/Port Moresby | UTC + 10:00 |
Yakutsk Standard Time | Asia/Yakutsk | UTC + 10:00 |
Central Pacific Standard Time | Pacific/Guadalcanal | UTC + 11:00 |
Russia Time Zone 10 | Asia/Srednekolymsk | UTC + 11:00 |
Vladivostok Standard Time | Asia/Vladivostok | UTC + 11:00 |
Fiji Standard Time | Pacific/Fiji | UTC + 12:00 |
Magadan Standard Time | Asia/Magadan | UTC + 12:00 |
New Zealand Standard Time | Pacific/Auckland | UTC + 12:00 |
Russia Time Zone 11 | Asia/Kamchatka | UTC + 12:00 |
UTC+12 | Pacific/Tarawa | UTC + 12:00 |
Tonga Standard Time | Pacific/Tongatapu | UTC + 13:00 |
Line Islands Standard Time | Pacific/Kiritimati | UTC + 14:00 |
Create appointments in different time zones
You can create appointments at different time zones using the StartTimeZone and EndTimeZone properties of ScheduleAppointment. An appointment’s start time and end time are calculated based on the given time zone information for the start time and end time. You can set different time zones to the StartTimeZone and EndTimeZone properties.
You can use the StartTime and EndTime properties of ScheduleAppointment to get the exact start time and end time of an appointment. By using the ActualStartTime and ActualEndTime properties, you can get exact appointment rendering time.
appointment.StartTimeZone = "India Standard Time";
appointment.EndTimeZone = "India Standard Time";
DateTime exactStartTime = appointment.StartTime;
DateTime exactEndTime = appointment.EndTime;
NOTE
- If the recurring appointment is converted to another time zone, then the whole sequence will be recalculated according to the new time zone information.
- If you create an all-day appointment, its start time and end time will be set to 12 A.M. and 12 A.M. by default, so time zone is not applicable for all-day appointments.
- Schedule supports daylight saving time.
- The time zone support is applicable for custom appointments too, so you need to map the corresponding property.
- You can use
TimeZone
for custom appointments by mapping the StartTimeZoneMapping and EndTimeZoneMapping custom properties of ScheduleAppointmentMapping.
Display Appointments based on client’s time zone
You can display the appointments based on the client’s local time zone in schedule. For example, consider a scenario that you are in North Carolina and you want to set up a meeting at 10 A.M. on North Carolina time. You have colleagues in London and Chennai, and they also need to participate. The time for this meeting will be 3 P.M. (15:00) in London and 5.30 A.M. in Chennai. When you see the each view of your calendar, you need to see the appointment displayed relative to your local time zones 5.30 A.M., 10 A.M., and 3 P.M., respectively. It can be achieved by setting schedule time zone to default (it will consider your device’s local time zone as schedule time zone) and appointment’s time zone to Eastern Standard Time (North Carolina)
[as you are in North Carolina and its time zone is Eastern Standard Time].
<schedule:SfSchedule x:Name="Schedule" DataSource="{Binding Meetings}" ScheduleView="MonthView" ShowAppointmentsInline="True">
<schedule:SfSchedule.AppointmentMapping>
<schedule:ScheduleAppointmentMapping
ColorMapping="Color"
EndTimeMapping="To"
StartTimeMapping="From"
SubjectMapping="EventName"
StartTimeZoneMapping="StartTimeZone"
EndTimeZoneMapping="EndTimeZone">
</schedule:ScheduleAppointmentMapping>
</schedule:SfSchedule.AppointmentMapping>
</schedule:SfSchedule>
Schedule.AppointmentMapping.ColorMapping = "Color";
Schedule.AppointmentMapping.StartTimeMapping = "From";
Schedule.AppointmentMapping.EndTimeMapping = "To";
Schedule.AppointmentMapping.SubjectMapping = "EventName";
Schedule.AppointmentMapping.StartTimeZoneMapping = "StartTimeZone";
Schedule.AppointmentMapping.EndTimeZoneMapping = "EndTimeZone";
You can set the appointment’s time zone to Eastern Standard Time (North Carolina)
by using the StartTimeZone
and EndTimeZone
properties.
namespace ScheduleXamarin
{
public class Meeting
{
...
public string StartTimeZone { get; set; }
public string EndTimeZone { get; set; }
...
}
}
namespace ScheduleXamarin
{
public class SchedulerViewModel : INotifyPropertyChanged
{
private void AddAppointments()
{
var meeting = new Meeting();
meeting.StartTimeZone = "W. Europe Standard Time";
meeting.EndTimeZone = "W. Europe Standard Time";
...
this.Meetings.Add(meeting);
}
}
}
You can download the entire source code from here.
Display appointments based on schedule time zone
You can set specific time zone to schedule using the TimeZone property of schedule. On this scenario, the appointments will be displayed in UTC time when the StartTimeZone
and EndTimeZone
properties of ScheduleAppointment
are set to null. The appointments will be displayed in UTC time based on the given schedule time zone.
<syncfusion:SfSchedule
x:Name="schedule"
TimeZone="GMT Standard Time">
</schedule:SfSchedule>
schedule.TimeZone = "GMT Standard Time";
Display appointments at same time everywhere regardless of client’s time zone
You can display appointments at the same time everywhere without considering the time zone when you set the TimeZone
property of schedule, the StartTimeZone
, and EndTimeZone
properties of ScheduleAppointment
to null. The appointments will be displayed based on the given StartTime
and EndTime
of appointment everywhere without considering the time zone.
Updating StartTime and EndTime after drag and drop appointment based on Time Zone.
After rescheduling an appointment using drag and drop
, appointment’s start and end time value will be updated based on schedule time zone and appointment’s time zone.
For an example, consider, your local time zone is India Standard Time
, if you drag an appointment from 9 AM and drop this on 1 PM and the schedule’s TimeZone
is not set and the appointment’s StartTimeZone
and EndTimeZone
has set as AUS Central Standard Time (Darwin)
then appointment’s start time and end time value will be converted from Local time zone to appointment time zone and the appointment’s start time will be saved at 9 AM,
if you set schedule’s TimeZone
as AUS Central Standard Time (Darwin)
and the appointment’s StartTimeZone
and EndTimeZone
as Central Standard Time (Mexico)
then the appointment’s start time and end time value has converted from schedule’s time zone to appointment time zone and the appointment’s start time will be saved at 3.30 AM of next day,
if you set schedule’s TimeZone
as AUS Central Standard Time (Darwin)
and appointment’s time zone was not set then the appointment’s start time and end time value converted from schedule time zone to UTC time zone and the appointment’s start time will be saved at 10.30 PM.
NOTE
You can refer to our Xamarin Scheduler feature tour page for its groundbreaking feature representations. You can also explore our Xamarin Scheduler example to understand how to schedule and manage appointments.