简体   繁体   English

如何在EWS中创建时区被忽略的约会

[英]How do i Create Appointment in EWS with Timezone ignored

How do i Create Appointment in EWS with Timezone ignored 如何在EWS中创建时区被忽略的约会

Im using EWS to Create an Appointment but when the user sees the appointment the time is off by 3 hours. 我使用EWS创建约会,但是当用户看到约会时,时间减少了3个小时。

How do I get Excahgne to take whatever time i give it and assume its in the users timezone? 我如何让Excahgne花费我付出的所有时间,并假设其在用户所在的时区?

You cannot ignore timezones, but if you do not define the timezone it will use UTC. 您不能忽略时区,但是如果不定义时区,它将使用UTC。 To use the Exchange Service Timezone, do the below: 若要使用Exchange服务时区,请执行以下操作:

Appointment a = new Appointment(Service);

// If using Exchange 2007 SP1
a.StartTimeZone = Service.TimeZone;

// If using Exchange 2010 or Higher
a.StartTimeZone = Service.TimeZone;
a.EndTimeZone = Service.TimeZone;

To use the timezone of the local computer, use TimeZoneInfo.Local 若要使用本地计算机的时区,请使用TimeZoneInfo.Local

Appointment a = new Appointment(Service);

// If using Exchange 2007 SP1
a.StartTimeZone = TimeZoneInfo.Local;

// If using Exchange 2010 or Higher
a.StartTimeZone = TimeZoneInfo.Local;
a.EndTimeZone = TimeZoneInfo.Local;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM